/* ==========================================================================
   Avi-Go Academy — shared stylesheet
   1. Tokens & base          (global)
   2. Header / toast / footer(global)
   3. Portal pages           (index, cases, prompts — body.portal)
   4. Learning view          (course pages — DO NOT restructure)
   5. Markdown output        (live demo rendering)
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@500;600&display=swap");

:root {
  --header-height: 72px;
  /* Claude / Anthropic editorial palette: warm ivory ground, near-black ink, single clay accent */
  --ink: #141413;
  --muted: #566173;
  --soft: #98a0ac;
  --paper: #f7f8fa;
  --surface: #ffffff;
  --line: #e5e8ec;

  /* the single brand accent — cool blue (Fable-card family: deep blue / light blue / grays / black).
     Token names kept as --clay* for back-compat; values are now blue. */
  --clay: #4574cc;          /* primary blue */
  --clay-deep: #37599f;     /* darker blue — hover / active */
  --clay-tint: #e9f0fb;     /* light-blue wash — chips, badges, soft fills */
  --accent-field: #6ba3e8;  /* the card's light blue — illustration fields / hero glow */

  /* editorial accent fields for hand-drawn art blocks (use at most one per block) */
  --heather: #cbcadb;
  --oat: #e3dacc;
  --cactus: #bcd1ca;
  --sky-field: #6a9bcc;
  --ivory: #faf9f5;

  /* dark bands go cool near-black blue (footer / dark CTA / prompts stats board) */
  --ink-field: #1b2431;
  --ink-field-2: #131a24;

  /* legacy aliases — keep older inline references (var(--blue)/--navy/--night/--sky) working,
     all re-pointed onto the blue palette so no per-file edits are needed */
  --blue: var(--clay);
  --navy: #1b2431;
  --navy-deep: #131a24;
  --night: #131a24;
  --sky: var(--clay);
  --aqua: var(--clay);

  --max: 1180px;
  --course-sidebar: 310px;
  /* one sans family everywhere — display is the same stack, just heavier */
  --font-display: Inter, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  --font-body: Inter, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { color: inherit; cursor: pointer; font: inherit; }
svg { display: block; }
h1, h2, h3, p { margin-top: 0; }

/* --------------------------------------------------------------------------
   Header (shared by every page)
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  display: grid;
  /* 1fr auto 1fr keeps the nav centred on the PAGE, not in the gap between the
     brand and the actions — so pages with a different right-hand cluster (the
     Data Dictionary has no language switcher) don't shift the tabs. */
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--header-height);
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(14px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; width: max-content; }
.brand-mark { width: 28px; height: 28px; }
.brand-mark svg { width: 100%; height: 100%; fill: none; stroke: var(--navy); stroke-linejoin: round; stroke-width: 2; }
.brand strong { font-family: var(--font-body); font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.brand > span:last-child { margin-left: 3px; padding-left: 11px; border-left: 1px solid #ccd0d4; color: #69717b; font-size: 13px; }
.brand-block { display: inline-flex; flex-direction: column; justify-content: center; gap: 3px; }
.brand-slogan { padding-left: 38px; color: #8b929c; font-size: 9.5px; font-weight: 650; letter-spacing: .03em; line-height: 1; white-space: nowrap; }
.primary-nav { display: flex; justify-content: center; align-items: center; gap: 30px; height: 100%; }
.primary-nav a { position: relative; color: #5b636e; font-size: 13.5px; font-weight: 550; white-space: nowrap; }
.primary-nav a:hover, .primary-nav a.active { color: var(--ink); }
.primary-nav a.active::after { position: absolute; right: 0; bottom: -27px; left: 0; height: 2px; background: var(--blue); content: ""; }
.header-actions { display: flex; justify-content: flex-end; justify-self: end; align-items: center; gap: 16px; }
.search-button { display: flex; align-items: center; gap: 7px; padding: 8px; border: 0; background: transparent; color: var(--muted); font-size: 12.5px; }
.search-button svg { width: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.7; }
.login-link { font-size: 12.5px; font-weight: 600; }
.open-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--clay);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .16s ease, transform .16s ease;
}
.open-button:hover { background: var(--clay-deep); }
.open-button:active { transform: translateY(1px); }
.mobile-menu { display: none; }

/* Language switcher (custom dropdown; whole pill is the trigger) */
.lang-switch { position: relative; }

/* The floating language switcher's styles live inline in prompts.html — the
   SEO CDN fronting avi-go.com caches this stylesheet separately from the page
   and served a stale copy, leaving the pill unstyled. Keep them with the HTML. */
.lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.lang-trigger:hover { border-color: #b8bdc4; }
.lang-trigger[aria-expanded="true"] { border-color: var(--clay); box-shadow: 0 0 0 3px rgba(69, 116, 204, .16); }
.lang-trigger .lang-name { min-width: 3.5em; text-align: left; }
.lang-caret { width: 14px; height: 14px; color: var(--soft); transition: transform .18s ease; }
.lang-trigger[aria-expanded="true"] .lang-caret { transform: rotate(180deg); }
.lang-flag {
  display: block;
  width: 24px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
}
.lang-flag svg { display: block; width: 100%; height: 100%; }

.lang-menu {
  position: absolute;
  z-index: 200;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  margin: 0;
  padding: 7px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(20, 20, 19, .14);
  animation: lang-pop .16s cubic-bezier(.16, 1, .3, 1);
  max-height: min(64vh, 420px);
  overflow-y: auto;
}
.lang-menu[hidden] { display: none; }
@keyframes lang-pop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .lang-menu, .lang-caret { animation: none; transition: none; } }
.lang-option {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 550;
  text-align: left;
  cursor: pointer;
  transition: background .13s ease;
}
.lang-option:hover { background: var(--paper); }
.lang-option .lang-name { flex: 1; }
.lang-option[aria-selected="true"] { color: var(--blue); font-weight: 650; }
.lang-check { width: 16px; height: 16px; color: var(--blue); opacity: 0; }
.lang-option[aria-selected="true"] .lang-check { opacity: 1; }

/* --------------------------------------------------------------------------
   Shared small pieces
   -------------------------------------------------------------------------- */
.eyebrow { display: block; margin-bottom: 18px; color: var(--blue); font-size: 10.5px; font-weight: 750; letter-spacing: .15em; text-transform: uppercase; }
.eyebrow.light { color: var(--sky); }

.toast {
  position: fixed;
  z-index: 300;
  right: 22px;
  bottom: 22px;
  max-width: min(420px, calc(100vw - 44px));
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 12px 35px rgba(0, 0, 0, .22);
  font-size: 12.5px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: .18s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* Scroll reveal (portal pages only; JS gates on prefers-reduced-motion) */
.pre-reveal { opacity: 0; transform: translateY(16px); }
.pre-reveal.revealed {
  opacity: 1;
  transform: none;
  transition: opacity .65s ease, transform .65s cubic-bezier(.16, 1, .3, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

/* ==========================================================================
   3. PORTAL PAGES (body.portal — index / cases / prompts)
   ========================================================================== */
.portal h1, .portal h2, .portal h3 { font-family: var(--font-display); font-weight: 700; }

.portal .wrap { max-width: var(--max); margin: 0 auto; padding-left: 40px; padding-right: 40px; }

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}
.btn:active { transform: translateY(1px); }
/* primary — clay solid; reads on both ivory sections and dark bands */
.btn.solid-light { background: var(--clay); color: #fff; }
.btn.solid-light:hover { background: var(--clay-deep); }
/* secondary on light sections — ink outline */
.btn.ghost-light { border-color: rgba(20, 20, 19, .22); color: var(--ink); }
.btn.ghost-light:hover { border-color: var(--ink); background: rgba(20, 20, 19, .04); }
.btn.solid-dark { background: var(--ink); color: #fff; }
.btn.solid-dark:hover { background: var(--clay); }

/* North-east "opens elsewhere" arrow. Drawn as an SVG rather than the "\2197"
   character, which iOS/Android render as a colour emoji inside a grey box. */
.ico-ne { display: inline-flex; align-items: center; flex-shrink: 0; }
.ico-ne svg { display: block; width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.text-link { display: inline-flex; gap: 10px; align-items: center; padding-bottom: 4px; border-bottom: 1px solid currentColor; color: var(--ink); font-size: 13.5px; font-weight: 600; }
.text-link:hover { color: var(--clay); }

.portal-section { padding: 104px 0; }
.portal-section + .portal-section { border-top: 1px solid var(--line); }
.portal-section > .wrap > h2,
.section-title {
  max-width: 720px;
  margin-bottom: 18px;
  font-size: clamp(34px, 4vw, 50px);
  letter-spacing: -.025em;
  line-height: 1.04;
}
.section-lede { max-width: 620px; margin-bottom: 54px; color: var(--muted); font-size: 16px; line-height: 1.7; }

/* --------------------------------------------------------------------------
   Home — aurora background
   A light pastel aurora fills the top of the page and runs *behind* the sticky
   header, so the nav sits inside the gradient instead of on a hard white band.
   The container carries a static gradient as the no-WebGL fallback; aurora.js
   adds .is-live and takes over with the shader canvas.
   -------------------------------------------------------------------------- */
.aurora-layer {
  position: absolute;
  z-index: 0;
  top: 0;
  right: 0;
  left: 0;
  /* Stops above the hero headline on purpose: the ribbon's lower edge crossing
     the H1 washed the type out. Everything below this is plain paper. */
  height: max(300px, 38dvh);
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(120% 96% at 10% -18%, #cddfff 0%, rgba(205, 223, 255, 0) 62%),
    radial-gradient(112% 88% at 88% -14%, #cfe9f7 0%, rgba(207, 233, 247, 0) 58%),
    radial-gradient(90% 74% at 50% -12%, #ded9fb 0%, rgba(222, 217, 251, 0) 64%);
  /* the shader's own falloff does most of the fade; the mask only clears the
     last few pixels so the ribbon never ends on a hard edge */
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 52%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 52%, transparent 100%);
}
.aurora-layer.is-live { background: none; }
.aurora-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: .78; }
/* content rides above the aurora */
.home-page main { position: relative; z-index: 1; }

/* Every portal page shares one header behaviour: borderless and transparent at
   rest (on Home that puts the nav inside the aurora), picking up the frosted
   ground + divider the moment the page scrolls. Keeping it uniform means
   switching tabs never adds or removes a divider. */
.portal .site-header {
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
  transition: background .28s ease, border-color .28s ease, backdrop-filter .28s ease;
}
.portal .site-header.is-stuck,
body.mobile-nav-open.portal .site-header {
  border-bottom-color: var(--line);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(14px);
}

/* --------------------------------------------------------------------------
   Home — hero (night navigation chart)
   -------------------------------------------------------------------------- */
.home-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  gap: 40px;
  align-items: center;
  min-height: calc(100dvh - var(--header-height));
  padding: 48px max(40px, calc((100vw - var(--max)) / 2)) 72px;
  overflow: hidden;
  background: transparent; /* the aurora layer behind it is the hero ground */
  color: var(--ink);
}
/* faint ink horizon line at the base of the hero */
.home-hero::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 8%, rgba(20, 20, 19, .12) 50%, transparent 92%);
  content: "";
}
.hero-copy { position: relative; z-index: 2; }
.hero-copy h1 {
  margin-bottom: 26px;
  /* three hand-broken lines — sized so each one holds on a single row */
  font-size: clamp(36px, 4.4vw, 56px);
  letter-spacing: -.028em;
  line-height: 1.05;
}
.hero-copy h1 em { color: var(--clay); font-style: normal; }
/* CJK has no word spaces and breaks between any characters, so the short
   first sentence can dangle a lone glyph onto a second line. Keep it whole. */
html[lang="zh-CN"] .hero-copy h1 > span:first-child { white-space: nowrap; }
/* CJK glyphs fill the whole em box, so the latin 1.05 leading collides */
html[lang="zh-CN"] .hero-copy h1,
html[lang="ja"] .hero-copy h1,
html[lang="ko"] .hero-copy h1 { line-height: 1.2; }
.hero-copy p { max-width: 520px; margin-bottom: 38px; color: var(--muted); font-size: 17px; line-height: 1.7; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-chart-wrap { position: relative; z-index: 1; min-width: 0; }
.hero-chart { width: 100%; height: auto; }
.hero-chart .grat { fill: none; stroke: rgba(20, 20, 19, .06); }
.hero-chart .arc { fill: none; stroke: rgba(20, 20, 19, .3); stroke-dasharray: 3 7; stroke-linecap: round; stroke-width: 1.4; }
.hero-chart .arc.main { stroke: var(--ink); stroke-dasharray: none; stroke-width: 2; stroke-linecap: round; }
.hero-chart .wp { fill: var(--clay); }
.hero-chart .wp-halo { fill: none; stroke: rgba(20, 20, 19, .2); stroke-width: 1.4; }
.hero-chart .wp-code { fill: var(--ink); font-family: var(--font-mono); font-size: 13px; font-weight: 600; letter-spacing: .06em; }
.hero-chart .flier {
  fill: var(--clay);
  filter: drop-shadow(0 1px 2px rgba(20, 20, 19, .25));
  transform: translate(273px, 152px); /* mid-route fallback */
}
@supports (offset-path: path("M0 0 H 1")) {
  .hero-chart .flier {
    transform: none;
    offset-path: path("M118 168 Q 320 132 428 348");
    offset-rotate: 0deg;
    offset-distance: 62%;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .hero-chart .flier { animation: hero-fly 8s cubic-bezier(.45, .05, .55, .95) infinite; }
  .hero-copy > * { animation: hero-rise .8s cubic-bezier(.16, 1, .3, 1) both; }
  .hero-copy > p { animation-delay: .08s; }
  .hero-copy > .hero-actions { animation-delay: .16s; }
  .hero-chart-wrap { animation: hero-rise 1s cubic-bezier(.16, 1, .3, 1) .1s both; }
}
@keyframes hero-fly {
  0% { offset-distance: 0%; opacity: 0; }
  10% { opacity: 1; }
  86% { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}
@keyframes hero-rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   Home — how it works (flight-plan line)
   -------------------------------------------------------------------------- */
.flight-steps { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.flight-steps li { position: relative; padding-top: 34px; }
/* the dashed track */
.flight-steps li::before {
  position: absolute;
  top: 5px;
  right: -40px;
  left: 14px;
  border-top: 1px dashed #c3c7cc;
  content: "";
}
.flight-steps li:last-child::before { right: 14px; }
.flight-steps .node {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  width: 11px;
  height: 11px;
  border: 2px solid var(--blue);
  border-radius: 50%;
  background: var(--paper);
}
.flight-steps li:last-child .node { background: var(--blue); }
.flight-steps .step-code { display: block; margin-bottom: 14px; color: var(--soft); font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: .08em; }
.flight-steps h3 { margin-bottom: 10px; font-size: 22px; letter-spacing: -.02em; }
.flight-steps p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }

/* --------------------------------------------------------------------------
   Home — featured cases
   -------------------------------------------------------------------------- */
.section-head-row { display: flex; flex-wrap: wrap; gap: 18px 40px; justify-content: space-between; align-items: flex-end; margin-bottom: 44px; }
.section-head-row h2 { margin: 0; max-width: 640px; font-size: clamp(34px, 4vw, 50px); letter-spacing: -.025em; line-height: 1.04; }

.featured-primary {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
  transition: box-shadow .2s ease, transform .2s ease;
}
.featured-primary:hover { box-shadow: 0 22px 55px rgba(20, 20, 19, .1); transform: translateY(-2px); }
.featured-art {
  position: relative;
  display: grid;
  min-height: 320px;
  padding: 28px;
  background:
    radial-gradient(95% 95% at 22% 12%, #dbe6f7 0%, transparent 62%),
    #e6ecf4;
  place-items: center;
}
.featured-art svg { width: min(100%, 380px); height: auto; }
.featured-art .arc { fill: none; stroke: rgba(20, 20, 19, .72); stroke-dasharray: 3 7; stroke-linecap: round; stroke-width: 1.6; }
.featured-art .wp { fill: var(--clay); }
.featured-art .wp-halo { fill: none; stroke: rgba(20, 20, 19, .28); stroke-width: 1.4; }
.featured-art .wp-code { fill: var(--ink); font-family: var(--font-mono); font-size: 15px; font-weight: 600; letter-spacing: .06em; }
.featured-art .plane { fill: var(--ink); }
.featured-body { display: flex; flex-direction: column; justify-content: center; padding: 48px; }
.case-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.case-tags span {
  padding: 6px 12px;
  border-radius: 999px;
  background: #eef0f3;
  color: #6f6a5e;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.case-tags span:first-child { background: var(--clay-tint); color: var(--clay-deep); }
.featured-body h3 { margin-bottom: 14px; font-size: clamp(26px, 2.6vw, 34px); letter-spacing: -.02em; line-height: 1.12; }
.featured-body > p { max-width: 480px; margin-bottom: 26px; color: var(--muted); font-size: 14.5px; line-height: 1.7; }
.case-outcome { display: grid; gap: 6px; margin-bottom: 30px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.case-outcome span { color: var(--soft); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.case-outcome strong { font-size: 14px; }
.case-open-cta { display: inline-flex; gap: 14px; align-items: center; color: var(--blue); font-size: 14px; font-weight: 650; }

.featured-secondary-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.featured-secondary, .featured-more {
  display: flex;
  flex-direction: column;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  transition: box-shadow .2s ease, transform .2s ease;
}
.featured-secondary:hover, .featured-more:hover { box-shadow: 0 18px 45px rgba(20, 20, 19, .09); transform: translateY(-2px); }
.featured-secondary h3 { margin-bottom: 12px; font-size: 24px; letter-spacing: -.02em; line-height: 1.15; }
.featured-secondary p { margin: 0 0 22px; max-width: 520px; color: var(--muted); font-size: 14px; line-height: 1.68; }
.featured-secondary .case-open-cta { margin-top: auto; }
.featured-more { justify-content: space-between; background: var(--clay); border-color: var(--clay); color: #fff; }
.featured-more span { color: rgba(255, 255, 255, .82); font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; letter-spacing: .06em; }
.featured-more strong { display: flex; justify-content: space-between; gap: 18px; align-items: baseline; font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: -.02em; }

/* --------------------------------------------------------------------------
   Home — example asks
   -------------------------------------------------------------------------- */
.ask-list { display: grid; margin-bottom: 40px; border-top: 1px solid var(--line); }
.ask-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px 44px; align-items: center; padding: 30px 0; border-bottom: 1px solid var(--line); }
.ask-row p { margin: 0; max-width: 760px; font-family: var(--font-display); font-size: clamp(16px, 1.8vw, 21px); font-weight: 600; letter-spacing: -.012em; line-height: 1.45; }
.ask-row p::before { content: "\201C"; color: var(--soft); }
.ask-row p::after { content: "\201D"; color: var(--soft); }
/* Ask Avi-Go.AI button. Fixed 40px height so the collapsed form is a true
   circle and the labelled form is exactly that circle stretched sideways —
   same geometry everywhere the action appears. */
.ask-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 40px;
  padding: 0 18px;
  border: 1px solid rgba(69, 116, 204, .32);
  border-radius: 999px;
  background: var(--clay-tint);
  color: var(--clay-deep);
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.ask-btn svg { display: block; width: 15px; height: 15px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ask-btn:hover { border-color: var(--clay); background: var(--clay); color: #fff; }
.ask-btn:active { transform: translateY(1px); }

/* --------------------------------------------------------------------------
   Home — who it's for
   -------------------------------------------------------------------------- */
.roles-split { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 70px; align-items: start; }
.roles-split h2 { margin-bottom: 18px; font-size: clamp(34px, 4vw, 50px); letter-spacing: -.025em; line-height: 1.06; }
.roles-split > div > p { max-width: 420px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.7; }
.role-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.role-list li { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 24px; align-items: baseline; padding: 18px 20px; border-radius: 12px; transition: background .15s ease; }
.role-list li:hover { background: #fff; }
.role-list strong { font-family: var(--font-display); font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.role-list span { color: var(--muted); font-size: 14px; line-height: 1.6; }

/* --------------------------------------------------------------------------
   Home — intro (what business aviation / Avi-Go / the assistant are)
   -------------------------------------------------------------------------- */
.intro-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.intro-grid article { padding: 30px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.intro-grid .intro-eyebrow { color: var(--clay-deep); font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.intro-grid h3 { margin: 12px 0 10px; font-size: 21px; letter-spacing: -.015em; }
.intro-grid p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.68; }

/* --------------------------------------------------------------------------
   Home — what data Avi-Go.AI can draw on
   -------------------------------------------------------------------------- */
/* horizontal icon strip — one tile per data type (icon in a soft-blue square + label) */
.data-chips { display: flex; flex-wrap: wrap; gap: 18px 10px; margin: 0 0 46px; padding: 0; list-style: none; }
.data-chips li {
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  flex: 1 1 0; min-width: 84px; max-width: 130px; text-align: center;
}
.data-chips .chip-ic {
  display: grid; place-items: center; width: 48px; height: 48px;
  border-radius: 13px; background: var(--clay-tint); color: var(--clay);
}
.data-chips .chip-ic svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.data-chips li span[data-i18n] { font-size: 12.5px; font-weight: 600; color: var(--muted); line-height: 1.3; }
.data-ask-intro { margin: 0 0 20px; color: var(--soft); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
/* Narrow screens: flex wrapping left the rows on different column rhythms and
   stranded the last tile. A 3-column grid keeps every icon on the same
   vertical line and divides the nine data types into three even rows. */
@media (max-width: 720px) {
  .data-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px 8px; align-items: start; }
  .data-chips li { min-width: 0; max-width: none; }
}

/* --------------------------------------------------------------------------
   Home — "what's inside the Academy" pillars (Role / Prompts / Dictionary)
   -------------------------------------------------------------------------- */
.pillar-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.pillar-card {
  display: flex; flex-direction: column;
  padding: 34px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.pillar-card:hover { border-color: rgba(69, 116, 204, .5); box-shadow: 0 18px 45px rgba(20, 20, 19, .09); transform: translateY(-2px); }
.pillar-eyebrow { color: var(--clay-deep); font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.pillar-card h3 { margin: 14px 0 12px; font-size: 23px; letter-spacing: -.02em; line-height: 1.15; }
.pillar-card > p { flex: 1; margin: 0 0 22px; color: var(--muted); font-size: 14px; line-height: 1.66; }

@media (max-width: 900px) {
  .intro-grid, .pillar-grid { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   Home — closing CTA band
   -------------------------------------------------------------------------- */
/* Light closing band: a pale blue wash rather than a dark field, so the page
   lands softly and the CTA keeps the same ink-on-paper register as the rest. */
.cta-band {
  padding: 96px max(40px, calc((100vw - var(--max)) / 2));
  border-top: 1px solid var(--line);
  background:
    radial-gradient(88% 130% at 50% -25%, rgba(107, 163, 232, .22) 0%, transparent 62%),
    linear-gradient(180deg, #eef3fb 0%, #f5f8fc 100%);
  color: var(--ink);
  text-align: center;
}
.cta-band h2 { margin-bottom: 16px; font-size: clamp(32px, 4vw, 52px); letter-spacing: -.025em; line-height: 1.05; }
.cta-band p { max-width: 520px; margin: 0 auto 36px; color: var(--muted); font-size: 16px; line-height: 1.7; }

/* --------------------------------------------------------------------------
   Footer (home)
   -------------------------------------------------------------------------- */
.site-footer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: center;
  padding: 38px max(30px, calc((100vw - var(--max)) / 2));
  border-top: 1px solid rgba(255, 255, 255, .08);
  background: var(--night);
  color: #fff;
}
.footer-brand > span { padding-left: 10px; border-left: 1px solid rgba(255, 255, 255, .25); color: rgba(255, 255, 255, .5); font-size: 12px; }
.site-footer p, .site-footer > span { margin: 0; color: rgba(255, 255, 255, .5); font-size: 12px; }

/* --------------------------------------------------------------------------
   Case library page
   -------------------------------------------------------------------------- */
.case-library-hero { padding: 76px 0 56px; }
.case-library-hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 70px; align-items: center; }
.case-library-hero h1 { max-width: 640px; margin-bottom: 18px; font-size: clamp(38px, 4.6vw, 60px); letter-spacing: -.028em; line-height: 1.03; }
.case-library-hero .hero-text p { max-width: 560px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.7; }

/* Flight-information-board style stats panel */
.hero-board {
  position: relative;
  padding: 18px 32px;
  border-radius: 16px;
  border: 1px solid rgba(20, 20, 19, .1);
  background:
    radial-gradient(120% 110% at 85% -10%, rgba(255, 255, 255, .6) 0%, transparent 55%),
    #dbe6f5;
  color: var(--ink);
  overflow: hidden;
}
.hero-board .board-arc { position: absolute; top: 0; right: 0; width: 62%; height: auto; opacity: .7; pointer-events: none; }
.hero-board .board-arc .arc { fill: none; stroke: rgba(20, 20, 19, .4); stroke-dasharray: 3 6; stroke-linecap: round; }
.hero-board .board-arc .wp { fill: var(--clay); }
.hero-board article { position: relative; display: flex; justify-content: space-between; gap: 24px; align-items: center; padding: 17px 0; border-bottom: 1px solid rgba(20, 20, 19, .13); }
.hero-board article:last-of-type { border-bottom: 0; }
.hero-board strong { color: var(--clay-deep); font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.hero-board span { font-family: var(--font-display); font-size: 36px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }

.case-library-main { padding: 0 0 110px; }
.case-library-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 22px; align-items: center; margin-bottom: 26px; padding-top: 26px; border-top: 1px solid var(--line); }
.case-library-toolbar p { margin: 0; color: var(--soft); font-size: 12.5px; font-weight: 600; }
.case-library-filters { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.case-library-filters::-webkit-scrollbar { display: none; }
.case-library-filters button {
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #59626e;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.case-library-filters button:hover { border-color: #b8bdc4; color: var(--ink); }
.case-library-filters button.active { border-color: var(--navy); background: var(--navy); color: #fff; }

.case-library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; }
.case-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
a.case-card:hover { border-color: rgba(69, 116, 204, .5); box-shadow: 0 20px 48px rgba(20, 20, 19, .1); transform: translateY(-3px); }
.case-card-art {
  position: relative;
  aspect-ratio: 2.3 / 1;
  background: linear-gradient(150deg, #e6ecf4, #cdd8e8);
}
.case-card-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.case-time {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px 6px 9px;
  border-radius: 999px;
  background: rgba(30, 24, 19, .58);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  border: 1px solid rgba(255, 255, 255, .2);
  color: #fbf3ee;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .01em;
}
.case-time svg { width: 13px; height: 13px; fill: none; stroke: #a9c8ef; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.case-card-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 18px 22px 0; }
.case-card-head .case-role { color: var(--blue); font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.case-card-head b {
  padding: 6px 11px;
  border-radius: 999px;
  background: #eef0f3;
  color: #6f6a5e;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.case-card-head b.is-ok { background: #e3efe0; color: #4b6b3f; }
.case-card-head b.is-beta { background: #e9f0fb; color: var(--clay-deep); }
.case-card-head b.is-plan { background: #eef0f3; color: #837d70; }
.case-card-body { padding: 14px 22px 20px; }
.case-card-body h2 { margin-bottom: 12px; font-size: 21px; letter-spacing: -.018em; line-height: 1.18; }
.case-card-body p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.62;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.case-card-foot { display: grid; gap: 14px; margin-top: auto; padding: 16px 22px 20px; border-top: 1px solid var(--line); }
.case-card-foot .capability-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 24px; }
.case-card-foot code {
  max-width: 100%;
  padding: 5px 11px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--clay-tint);
  color: var(--clay-deep);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.case-card-foot code.more { background: #f0f1f4; color: #6b7280; }
.case-card-foot strong { display: flex; justify-content: space-between; gap: 18px; color: var(--blue); font-size: 13px; font-weight: 650; }
.case-card.is-planned { border-style: dashed; background: transparent; }
.case-card.is-planned .case-card-body h2 { color: #6a727d; }
.case-card.is-planned .case-card-foot strong { color: var(--soft); }
.case-card.is-planned .case-card-foot code { background: #e9ebef; color: #8a8478; }
.case-library-empty {
  grid-column: 1 / -1;
  padding: 34px;
  border: 1px dashed #cfd3d7;
  border-radius: 14px;
  background: #fff;
  color: var(--soft);
  font-size: 14px;
}

/* --------------------------------------------------------------------------
   Responsive — portal + header
   -------------------------------------------------------------------------- */
@media (max-width: 1050px) {
  .site-header { padding: 0 18px; }
  .primary-nav { gap: 18px; }
  .header-actions { gap: 10px; }
  .search-button span { display: none; }
  .home-hero { grid-template-columns: 1fr; gap: 40px; padding-top: 56px; }
  .hero-chart-wrap { max-width: 520px; }
  .featured-primary { grid-template-columns: 1fr; }
  .featured-art { min-height: 240px; }
  .featured-body { padding: 34px 28px; }
  .featured-secondary-row { grid-template-columns: 1fr; }
  .roles-split { grid-template-columns: 1fr; gap: 40px; }
  .case-library-hero .wrap { grid-template-columns: 1fr; gap: 40px; }
  .hero-board { max-width: 480px; }
}

@media (max-width: 820px) {
  .site-header { grid-template-columns: 1fr auto; }
  .primary-nav, .header-actions { display: none; }
  .mobile-menu { display: grid; gap: 5px; width: 38px; height: 38px; padding: 8px; border: 0; background: transparent; place-content: center; }
  .mobile-menu span { display: block; width: 20px; height: 1.5px; background: var(--ink); transition: transform .24s cubic-bezier(.16, 1, .3, 1); }
  .primary-nav a.active::after { display: none; }

  /* ---- navigation panel ---------------------------------------------
     The header GROWS into the panel; it is not a separate overlay.

     This replaces a drawer built from three independent position:fixed
     children of the header. That coupling broke twice: a backdrop-filter on
     the header silently became their containing block, and `justify-self: end`
     (a desktop grid property) made the footer shrink-wrap to its button
     instead of spanning the width. With the rows living inside the header
     there is no fixed positioning left to mis-resolve, and the panel takes its
     height from its content, so four items no longer leave half the screen
     empty. */
  body.mobile-nav-open { overflow: hidden; }
  /* Out-specifies `.portal .site-header.is-stuck`, which re-applies the blur. */
  body.mobile-nav-open .site-header,
  body.mobile-nav-open.portal .site-header,
  body.mobile-nav-open.portal .site-header.is-stuck {
    height: auto;
    grid-template-columns: 1fr auto;
    grid-template-rows: var(--header-height) auto auto;
    padding: 0;
    background: #fff;
    border-bottom-color: var(--line);
    box-shadow: 0 20px 44px rgba(20, 20, 19, .14);
    /* Deliberately absent: backdrop-filter. Nothing here needs it, and it is
       what made the old drawer collapse. */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    animation: nav-panel-in .22s ease both;
  }
  body.mobile-nav-open .brand-block { grid-row: 1; grid-column: 1; padding-left: 14px; }
  body.mobile-nav-open .mobile-menu { grid-row: 1; grid-column: 2; margin-right: 8px; }
  /* The trigger becomes the close affordance. Tap-outside works too, but the X
     is what people look for. */
  body.mobile-nav-open .mobile-menu span:first-child { transform: translateY(3.25px) rotate(45deg); }
  body.mobile-nav-open .mobile-menu span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

  /* Scrim: dims the page behind the panel and, with the document handler in
     app.js, finally gives it a tap-outside-to-close. Sits under the header
     (z-index 100) and over everything else. */
  body.mobile-nav-open::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 99;
    background: rgba(20, 20, 19, .42);
    animation: nav-scrim-in .22s ease both;
  }

  body.mobile-nav-open .primary-nav {
    grid-row: 2;
    grid-column: 1 / -1;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 0;
    height: auto;
    /* Four items fit without scrolling; the cap only matters if a page ever
       grows the nav. dvh, not vh, so the iOS address bar cannot clip it. */
    max-height: calc(100dvh - var(--header-height) - 96px);
    padding: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-top: 1px solid var(--line);
  }
  body.mobile-nav-open .primary-nav a {
    display: flex;
    align-items: center;
    /* Transparent left rule on every row so the active one can fill it in
       without shifting the label. */
    border-left: 2px solid transparent;
    padding: 16px 20px 16px 18px;
    color: var(--ink);
    font-family: var(--font-display);
    /* Down from 27px: at four items that read as a wall of type rather than a
       menu. */
    font-size: 21px;
    font-weight: 600;
    letter-spacing: -.02em;
    line-height: 1.2;
    animation: nav-item-in .38s cubic-bezier(.16, 1, .3, 1) both;
  }
  body.mobile-nav-open .primary-nav a + a { border-top: 1px solid var(--line); }
  /* The 01/02/03 counters and the per-row chevrons are gone. The numbers
     implied a sequence these pages do not have (the same reason they came off
     the Data Dictionary rail), and a chevron on every row is decoration when
     the whole row is already the target. */
  body.mobile-nav-open .primary-nav a.active {
    border-left-color: var(--blue);
    background: #f6f8fd;
    color: var(--blue);
  }
  body.mobile-nav-open .primary-nav a:nth-child(1) { animation-delay: .03s; }
  body.mobile-nav-open .primary-nav a:nth-child(2) { animation-delay: .07s; }
  body.mobile-nav-open .primary-nav a:nth-child(3) { animation-delay: .11s; }
  body.mobile-nav-open .primary-nav a:nth-child(4) { animation-delay: .15s; }
  body.mobile-nav-open .primary-nav a:nth-child(n+5) { animation-delay: .19s; }

  /* Panel footer: the one CTA, full width. */
  body.mobile-nav-open .header-actions {
    grid-row: 3;
    grid-column: 1 / -1;
    align-self: stretch;
    /* The desktop header grid sets `justify-self: end`. Left in place it makes
       this row fit-content and stick to the right edge, which is exactly the
       bug that shipped: a 181px footer hugging the corner. */
    justify-self: stretch;
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line);
    background: #fff;
    animation: nav-foot-in .3s cubic-bezier(.16, 1, .3, 1) .08s both;
  }
  body.mobile-nav-open .header-actions .search-button,
  body.mobile-nav-open .header-actions .login-link { display: none; }
  body.mobile-nav-open .header-actions .open-button { flex: 1; justify-content: center; height: 46px; }
  body.mobile-nav-open .lang-menu { top: auto; bottom: calc(100% + 8px); }
}

/* Only opacity on the panel itself: a transform there would make the header a
   containing block again, which is the trap this rewrite exists to close. The
   row stagger carries the sense of the panel unfolding. */
@keyframes nav-panel-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes nav-scrim-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes nav-item-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes nav-foot-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  /* The panel selector has to be repeated at full strength: the rule that sets
     nav-panel-in also matches `body.mobile-nav-open.portal .site-header.is-stuck`,
     which out-specifies a plain `body.mobile-nav-open .site-header` and would
     keep the fade alive here. */
  body.mobile-nav-open .site-header,
  body.mobile-nav-open.portal .site-header,
  body.mobile-nav-open.portal .site-header.is-stuck,
  body.mobile-nav-open::after,
  body.mobile-nav-open .primary-nav,
  body.mobile-nav-open .primary-nav a,
  body.mobile-nav-open .header-actions { animation: none; }
}

@media (max-width: 820px) {
  .flight-steps { grid-template-columns: 1fr; gap: 34px; }
  .flight-steps li { padding-top: 0; padding-left: 34px; }
  .flight-steps li::before { top: 14px; right: auto; bottom: -34px; left: 5px; border-top: 0; border-left: 1px dashed #c3c7cc; }
  .flight-steps li:last-child::before { display: none; }
  .flight-steps .node { top: 4px; }
  .ask-row { grid-template-columns: 1fr; gap: 16px; }
}

@media (max-width: 600px) {
  :root { --header-height: 62px; }
  .site-header { height: var(--header-height); padding: 0 14px; }
  .brand > span:last-child { display: none; }
  .brand-slogan { display: none; }
  .portal .wrap { padding-left: 20px; padding-right: 20px; }
  .portal-section { padding: 76px 0; }
  .home-hero { padding: 44px 20px 60px; }
  .hero-copy h1 { font-size: 38px; }
  .hero-copy p { font-size: 15px; }
  .section-lede { margin-bottom: 40px; }
  .featured-body { padding: 28px 22px; }
  .featured-secondary, .featured-more { padding: 26px 22px; }
  .role-list li { grid-template-columns: 1fr; gap: 6px; padding: 16px 12px; }
  .cta-band { padding: 72px 20px; }
  .site-footer { grid-template-columns: 1fr; padding: 35px 20px; }
  .case-library-hero { padding: 56px 0 40px; }
  .case-library-hero h1 { font-size: 38px; }
  .hero-board { padding: 10px 22px; }
  .hero-board span { font-size: 30px; }
  .case-library-grid { grid-template-columns: 1fr; }
  .lesson-content { padding: 28px 20px 70px; }
  .lesson-article h1 { font-size: 43px; }
  .case-brief dl { grid-template-columns: repeat(2, 1fr); }
  .case-brief dl div:nth-child(2) { border-right: 0; }
  .case-brief dl div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .learning-objectives { grid-template-columns: 1fr; }
  .learning-objectives div, .learning-objectives div:nth-child(2n), .learning-objectives div:nth-child(n+3) { border-right: 0; border-bottom: 1px solid var(--line); }
  .learning-objectives div:last-child { border-bottom: 0; }
  .method-flow { grid-template-columns: 1fr; }
  .method-flow b { transform: rotate(90deg); justify-self: center; }
  .demo-chain, .prompt-notes, .deliverable-grid { grid-template-columns: 1fr; }
  .workflow-steps article { grid-template-columns: 32px 1fr; }
  .workflow-steps b { grid-column: 2; justify-self: start; }
  .proposal-option-table, .proposal-notes-grid { grid-template-columns: 1fr; }
  .proposal-option-table article, .proposal-notes-grid article, .proposal-notes-grid article:nth-child(2n), .proposal-notes-grid article:nth-child(n+3) { border-right: 0; border-bottom: 1px solid var(--line); }
  .proposal-option-table article:last-child, .proposal-notes-grid article:last-child { border-bottom: 0; }
  .deliverable-grid article { min-height: 190px; }
  .deliverable-grid h3 { margin-top: 48px; }
  .tools-in-case { grid-template-columns: 1fr; padding: 26px 20px; }
  .lesson-next { align-items: flex-start; flex-direction: column; gap: 22px; }
  .run-panel { padding: 24px 18px; }
  .results-heading { align-items: flex-start; flex-direction: column; }
  .config-row { align-items: flex-start; flex-direction: column; }
  .config-row strong { text-align: left; }
}

/* ==========================================================================
   4. LEARNING VIEW (course pages — structure preserved; do not refactor)
   ========================================================================== */
.learning-shell { display: grid; grid-template-columns: var(--course-sidebar) 1fr; min-height: calc(100vh - var(--header-height)); }
.course-sidebar { position: sticky; top: var(--header-height); height: calc(100vh - var(--header-height)); overflow-y: auto; border-right: 1px solid var(--line); background: #f1f2ef; }
.back-link { display: block; padding: 20px 22px; border-bottom: 1px solid #dadeDA; color: var(--blue); font-size: 12.5px; font-weight: 750; }
.back-link:hover { background: #fff; text-decoration: underline; }
.course-sidebar-title { padding: 25px 22px 20px; border-bottom: 1px solid #dadeDA; }
.course-sidebar-title > span { color: var(--blue); font-size: 8px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.course-sidebar-title h2 { margin: 10px 0 18px; font-size: 21px; letter-spacing: -.04em; line-height: 1.15; }
.course-progress { height: 3px; margin-bottom: 8px; border-radius: 999px; background: #d9dcda; overflow: hidden; }
.course-progress i { display: block; width: 5%; height: 100%; background: var(--blue); }
.course-sidebar-title small { color: #9298a0; font-size: 8px; }
.course-sidebar nav { padding: 12px; }
.course-sidebar nav a { display: grid; grid-template-columns: 25px 1fr; gap: 9px; padding: 11px 10px; border-radius: 7px; color: #626a74; }
.course-sidebar nav a:hover, .course-sidebar nav a.active { background: #fff; color: var(--ink); }
.course-sidebar nav a > span { padding-top: 2px; color: #9ba1a8; font-family: monospace; font-size: 8px; }
.course-sidebar nav strong { display: block; margin-bottom: 3px; font-size: 10.5px; }
.course-sidebar nav small { color: #9298a0; font-size: 8px; }
.course-menu-toggle { display: none; }
.lesson-content { display: grid; grid-template-columns: minmax(0, 780px) 230px; gap: 55px; max-width: 1120px; padding: 40px 45px 100px; }
.lesson-breadcrumb { grid-column: 1 / -1; display: flex; gap: 9px; color: #9298a0; font-size: 9px; }
.lesson-breadcrumb strong { color: #636b75; }
.lesson-article h1 { margin: 22px 0; font-size: clamp(42px, 5vw, 65px); font-weight: 610; letter-spacing: -.06em; line-height: 1.02; }
.lesson-labels { display: flex; flex-wrap: wrap; gap: 6px; }
.lesson-labels span { padding: 5px 8px; border-radius: 4px; background: #eef0f2; color: #69717b; font-size: 8px; font-weight: 750; text-transform: uppercase; }
.lesson-labels span:first-child { background: #eaf0ff; color: var(--blue); }
.lesson-intro { max-width: 700px; margin-bottom: 40px; color: var(--muted); font-size: 16px; line-height: 1.75; }
.case-brief { overflow: hidden; margin-bottom: 65px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.case-brief-heading { display: flex; justify-content: space-between; padding: 16px 20px; background: var(--navy); color: #fff; }
.case-brief-heading span { color: var(--aqua); font-size: 8px; font-weight: 750; text-transform: uppercase; }
.case-brief-heading strong { font-size: 11px; }
.case-brief dl { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; }
.case-brief dl div { padding: 20px; border-right: 1px solid var(--line); }
.case-brief dl div:last-child { border-right: 0; }
.case-brief dt { margin-bottom: 7px; color: var(--soft); font-size: 8px; font-weight: 750; text-transform: uppercase; }
.case-brief dd { margin: 0; font-size: 11px; font-weight: 650; }
.lesson-section { margin-bottom: 65px; }
.lesson-section > h2, .tools-in-case h2 { margin-bottom: 18px; font-size: 30px; letter-spacing: -.045em; }
.lesson-section > p { color: var(--muted); line-height: 1.7; }
.learning-objectives { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.learning-objectives div { min-height: 130px; padding: 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.learning-objectives div:nth-child(2n) { border-right: 0; }
.learning-objectives div:nth-child(n+3) { border-bottom: 0; }
.learning-objectives span { color: var(--soft); font-family: monospace; font-size: 8px; }
.learning-objectives p { margin: 42px 0 0; font-size: 12px; line-height: 1.55; }
.method-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; gap: 10px; align-items: center; margin-top: 27px; }
.method-flow > div { min-height: 110px; padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.method-flow span { display: block; margin-bottom: 25px; font-size: 10px; font-weight: 700; }
.method-flow small { color: var(--muted); font-size: 8px; line-height: 1.4; }
.method-flow b { color: #a2a7ae; font-weight: 400; }
.tool-chain-list { display: grid; gap: 10px; margin-top: 24px; }
.tool-chain-list article { display: grid; grid-template-columns: 42px 1fr; gap: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.tool-chain-list article > span { display: grid; width: 30px; height: 30px; border-radius: 999px; background: #eaf0ff; color: var(--blue); font-family: monospace; font-size: 10px; font-weight: 800; place-items: center; }
.tool-chain-list h3 { margin-bottom: 8px; font-size: 15px; letter-spacing: -.02em; }
.tool-chain-list p { margin-bottom: 10px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.tool-chain-list code { display: block; width: 100%; overflow-wrap: anywhere; color: #4b5563; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 9px; line-height: 1.5; }
.tool-chain-empty { padding: 16px; border: 1px dashed #cfd3d7; border-radius: 8px; color: var(--soft); font-size: 11px; }
.tools-in-case { display: grid; grid-template-columns: .7fr 1.3fr; gap: 40px; padding: 35px; border-radius: 12px; background: #10182e; color: #fff; }
.capability-cards { display: grid; gap: 7px; }
.capability-cards article { padding: 16px; border: 1px solid rgba(255,255,255,.13); border-radius: 8px; }
.capability-cards article > span { color: var(--aqua); font-size: 7px; font-weight: 750; text-transform: uppercase; }
.capability-cards h3 { margin: 7px 0; font-size: 15px; }
.capability-cards p { margin: 0; color: rgba(255,255,255,.55); font-size: 9px; line-height: 1.5; }
.lesson-next { display: flex; justify-content: space-between; align-items: center; margin-top: 75px; padding-top: 24px; border-top: 1px solid var(--line); }
.lesson-next div { display: grid; gap: 6px; }
.lesson-next div span { color: var(--soft); font-size: 8px; font-weight: 750; text-transform: uppercase; }
.lesson-next strong { font-size: 13px; }
.lesson-next button { display: flex; gap: 25px; padding: 12px 15px; border: 0; border-radius: 7px; background: var(--blue); color: #fff; font-size: 10px; font-weight: 700; }
.lesson-aside { align-self: start; margin-top: 57px; border-top: 1px solid var(--line); }
.lesson-aside > div { padding: 20px 0; border-bottom: 1px solid var(--line); }
.lesson-aside span { color: var(--soft); font-size: 8px; font-weight: 750; text-transform: uppercase; }
.lesson-aside strong { display: block; margin: 8px 0; font-size: 12px; }
.lesson-aside p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.lesson-aside > a { display: flex; justify-content: space-between; padding: 18px 0; font-size: 10px; font-weight: 700; }

.run-panel { display: grid; grid-template-columns: .75fr 1.25fr; gap: 34px; padding: 34px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.run-panel > div > p { color: var(--muted); font-size: 13px; line-height: 1.7; }
.run-card { display: grid; gap: 16px; }
.config-row { display: flex; justify-content: space-between; gap: 18px; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.config-row span { color: var(--soft); font-size: 8px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.config-row strong { font-size: 11px; text-align: right; }
.config-row strong.good { color: #067647; }
.config-row strong.warn { color: #b42318; }
#case-prompt-preview { max-height: 265px; margin: 0; padding: 16px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #f6f7f5; color: #3f4650; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 10px; line-height: 1.6; white-space: pre-wrap; }
.run-actions { display: flex; align-items: center; gap: 14px; }
.run-actions button, #refresh-artifacts-button { display: inline-flex; align-items: center; justify-content: center; gap: 18px; padding: 12px 15px; border: 0; border-radius: 7px; background: var(--blue); color: #fff; font-size: 10px; font-weight: 700; }
.run-actions button:disabled { cursor: wait; opacity: .6; }
.run-actions span { color: var(--soft); font-size: 10px; font-weight: 700; }
.results-heading { display: flex; justify-content: space-between; gap: 22px; align-items: end; margin-bottom: 20px; }
.results-heading h2 { margin-bottom: 0; font-size: 30px; letter-spacing: -.045em; }
#refresh-artifacts-button { flex-shrink: 0; background: var(--navy); }
.result-state { margin-bottom: 18px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); font-size: 12px; line-height: 1.6; }
.result-state strong { display: block; margin-bottom: 8px; color: var(--ink); font-size: 13px; }
.result-state p { margin: 0 0 10px; }
.result-state ul { margin: 0; padding-left: 18px; }
.result-state li + li { margin-top: 5px; }
.results-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.results-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.results-table th, .results-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 10px; line-height: 1.45; }
.results-table th { background: #f4f5f3; color: var(--soft); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.results-table tr:last-child td { border-bottom: 0; }
.artifact-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 18px; }
.artifact-link, .artifact-empty { min-height: 92px; padding: 16px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.artifact-link { display: grid; gap: 8px; }
.artifact-link span { color: var(--blue); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.artifact-link strong { font-size: 12px; line-height: 1.35; }
.artifact-link b { color: var(--muted); font-size: 10px; }
.artifact-empty { color: var(--soft); font-size: 11px; }

.demo-chain { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 26px; }
.demo-chain article { display: grid; grid-template-columns: 42px 1fr; gap: 14px; min-height: 145px; padding: 18px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.demo-chain article.highlight { border-color: rgba(46,95,234,.38); background: #f4f7ff; }
.demo-chain article > span { display: grid; width: 30px; height: 30px; border-radius: 999px; background: #eaf0ff; color: var(--blue); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 10px; font-weight: 800; place-items: center; }
.demo-chain h3 { margin: 2px 0 8px; font-size: 15px; letter-spacing: -.02em; }
.demo-chain p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.prompt-package pre { margin: 22px 0 18px; padding: 20px; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: #10182e; color: #f5f7fb; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11px; line-height: 1.65; white-space: pre-wrap; }
.prompt-notes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.prompt-notes article { padding: 18px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.prompt-notes span, .deliverable-grid span { color: var(--blue); font-size: 8px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.prompt-notes p { margin: 34px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.deliverable-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 24px; }
.deliverable-grid article { min-height: 220px; padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.deliverable-grid h3 { margin: 70px 0 10px; font-size: 18px; letter-spacing: -.035em; line-height: 1.15; }
.deliverable-grid p { margin: 0; color: var(--muted); font-size: 10.5px; line-height: 1.6; }
.proposal-run-panel { align-items: start; }
.proposal-run-card { min-width: 0; }
.workflow-steps { display: grid; gap: 9px; }
.workflow-steps article { display: grid; grid-template-columns: 34px 1fr auto; gap: 13px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.workflow-steps article > span { display: grid; width: 26px; height: 26px; border-radius: 999px; background: #eef2ff; color: var(--blue); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 9px; font-weight: 800; place-items: center; }
.workflow-steps h3 { margin: 0 0 5px; font-size: 13px; letter-spacing: -.02em; }
.workflow-steps p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.workflow-steps small { display: block; margin-top: 7px; color: #9b4a12; font-size: 9px; line-height: 1.45; overflow-wrap: anywhere; }
.workflow-steps b { padding: 5px 7px; border-radius: 999px; background: #eff1f4; color: #6b7280; font-size: 8px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.workflow-steps article.live b { background: #ecfdf3; color: #067647; }
.workflow-steps article.fallback b { background: #fff4e5; color: #9a4b00; }
.workflow-steps article.generated b { background: #eaf0ff; color: var(--blue); }
.proposal-result { margin-bottom: 18px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--muted); font-size: 12px; line-height: 1.6; }
.proposal-result strong { display: block; margin-bottom: 6px; color: var(--ink); font-size: 13px; }
.proposal-result p { margin: 0; }
.proposal-preview { margin-bottom: 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.proposal-preview-heading { padding: 24px; background: #10182e; color: #fff; }
.proposal-preview-heading span, .proposal-notes-grid span, .proposal-option-table span { color: var(--aqua); font-size: 8px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.proposal-preview-heading h3 { margin: 11px 0 10px; font-size: 26px; letter-spacing: -.045em; }
.proposal-preview-heading p { margin: 0; color: rgba(255,255,255,.68); font-size: 12px; line-height: 1.65; }
.proposal-option-table { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.proposal-option-table article { min-height: 175px; padding: 18px; border-right: 1px solid var(--line); }
.proposal-option-table article:last-child { border-right: 0; }
.proposal-option-table span, .proposal-notes-grid span { color: var(--blue); }
.proposal-option-table strong { display: block; margin: 38px 0 9px; font-size: 13px; line-height: 1.35; }
.proposal-option-table p, .proposal-option-table small, .proposal-notes-grid p { color: var(--muted); font-size: 10px; line-height: 1.55; }
.proposal-option-table p { margin: 0 0 8px; }
.proposal-option-table small { display: block; }
.proposal-notes-grid { display: grid; grid-template-columns: repeat(2, 1fr); }
.proposal-notes-grid article { min-height: 150px; padding: 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.proposal-notes-grid article:nth-child(2n) { border-right: 0; }
.proposal-notes-grid article:nth-child(n+3) { border-bottom: 0; }
.proposal-notes-grid p { margin: 30px 0 0; }

/* ==========================================================================
   5. Rendered Markdown for live demo output (tool runs, brief comparisons)
   ========================================================================== */
.md-body.md-body { white-space: normal; }
.md-body { font-family: var(--font-body); color: #343b46; font-size: 13.5px; line-height: 1.66; }
.md-body > *:first-child { margin-top: 0; }
.md-body > *:last-child { margin-bottom: 0; }
.md-body p { margin: 0 0 10px; }
.md-body h1, .md-body h2, .md-body h3, .md-body h4, .md-body h5, .md-body h6 { margin: 16px 0 8px; line-height: 1.3; letter-spacing: -.02em; color: var(--ink); }
.md-body h1 { font-size: 20px; }
.md-body h2 { font-size: 17px; }
.md-body h3 { font-size: 15px; }
.md-body h4, .md-body h5, .md-body h6 { font-size: 13.5px; }
.md-body ul, .md-body ol { margin: 0 0 10px; padding-left: 20px; }
.md-body li { margin: 3px 0; }
.md-body li > ul, .md-body li > ol { margin: 3px 0; }
.md-body a { color: var(--blue); text-decoration: underline; }
.md-body strong { color: var(--ink); font-weight: 700; }
.md-body em { font-style: italic; }
.md-body code { padding: 1px 5px; border-radius: 4px; background: #eef0f2; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .9em; }
.md-body pre.md-code { margin: 0 0 12px; padding: 12px 14px; overflow-x: auto; border-radius: 8px; background: #10182e; color: #f5f7fb; white-space: pre; }
.md-body pre.md-code code { padding: 0; background: none; color: inherit; font-size: 12px; line-height: 1.6; }
.md-body blockquote { margin: 0 0 10px; padding: 6px 14px; border-left: 3px solid var(--blue); color: var(--muted); }
.md-body hr { margin: 14px 0; border: 0; border-top: 1px solid var(--line); }
.md-body .md-table-wrap { margin: 0 0 12px; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; -webkit-overflow-scrolling: touch; }
.md-body table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.md-body th, .md-body td { padding: 8px 11px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; white-space: nowrap; }
.md-body thead th { background: #f4f6f9; font-weight: 700; color: var(--ink); }
.md-body tbody tr:nth-child(even) td { background: #fafbfc; }
.md-body tbody tr:last-child td { border-bottom: 0; }

/* "Ask Avi-Go" — a prompt button that opens straight into the Avi-Go chat.
   Doubled selector so it overrides each teaching page's inline .copy-template. */
.copy-template.avigo-ask, .avigo-ask {
  gap: 7px;
  height: 32px;
  padding: 0 14px;
  border-color: rgba(46, 95, 234, .28);
  border-radius: 999px;              /* same stretched circle as .ask-btn */
  background: #eef2ff;
  color: var(--blue);
  font-weight: 800;
  line-height: 1;
}
.avigo-ask .avigo-ask-ic { display: block; width: 13px; height: 13px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.copy-template.avigo-ask:hover, .avigo-ask:hover {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}
.copy-template.avigo-ask:focus-visible, .avigo-ask:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Arabic RTL — activated only when <html dir="rtl"> (set by i18n.js for ar).
   Additive overrides: browser auto-handles text direction, default alignment,
   and flex/grid main-axis reversal; below flips the explicit physical props
   (text-align, paddings, borders, absolute offsets) that don't flip on their own.
   Decorative SVG art (hero arc, flight-steps connectors) is intentionally left.
   -------------------------------------------------------------------------- */
[dir="rtl"] { text-align: right; }

/* Explicit left/right text alignment must mirror */
[dir="rtl"] .lang-trigger .lang-name,
[dir="rtl"] .lang-option,
[dir="rtl"] .results-table th,
[dir="rtl"] .results-table td,
[dir="rtl"] .md-body th,
[dir="rtl"] .md-body td,
[dir="rtl"] .config-row strong { text-align: right; }

/* Language dropdown opens aligned to its trigger (now on the left) */
[dir="rtl"] .lang-menu { right: auto; left: 0; }

/* Brand divider ("Avi-Go | Academy") + footer variant */
[dir="rtl"] .brand > span:last-child,
[dir="rtl"] .footer-brand > span {
  margin-left: 0; margin-right: 3px;
  padding-left: 0; padding-right: 11px;
  border-left: 0; border-right: 1px solid #ccd0d4;
}
[dir="rtl"] .brand-slogan { padding-left: 0; padding-right: 38px; }

/* List indent + blockquote accent flip to the right */
[dir="rtl"] .md-body ul,
[dir="rtl"] .md-body ol,
[dir="rtl"] .result-state ul { padding-left: 0; padding-right: 20px; }
[dir="rtl"] .md-body blockquote { border-left: 0; border-right: 3px solid var(--blue); padding: 6px 14px; }

/* Left sidebar sits on the right in RTL; its divider follows */
[dir="rtl"] .course-sidebar { border-right: 0; border-left: 1px solid var(--line); }

/* Grid/table column dividers (border-right) mirror to border-left */
[dir="rtl"] .case-brief dl div,
[dir="rtl"] .learning-objectives div,
[dir="rtl"] .proposal-option-table article,
[dir="rtl"] .proposal-notes-grid article { border-right: 0; border-left: 1px solid var(--line); }
[dir="rtl"] .case-brief dl div:last-child,
[dir="rtl"] .learning-objectives div:nth-child(2n),
[dir="rtl"] .proposal-option-table article:last-child,
[dir="rtl"] .proposal-notes-grid article:nth-child(2n) { border-left: 0; }

/* Toast slides in from the left corner */
[dir="rtl"] .toast { right: auto; left: 22px; }

/* Numbers/codes stay LTR inside RTL text (e.g. "LFMN", "2026", "15 min") */
[dir="rtl"] .lesson-labels span,
[dir="rtl"] .formula-strip,
[dir="rtl"] .results-table td { unicode-bidi: plaintext; }

/* Mobile: off-canvas sidebar slides in from the right */
@media (max-width: 900px) {
  [dir="rtl"] .course-sidebar { right: 0; left: auto; transform: translateX(100%); box-shadow: -18px 0 40px rgba(12, 20, 45, .18); }
  [dir="rtl"] body.course-nav-open .course-sidebar { transform: translateX(0); }
}

/* ==========================================================================
   6. HOME MOTION  (body.home-page) — scroll-desire + react-bits-style accents
      All vanilla; JS in app.js gates on prefers-reduced-motion.
   ========================================================================== */

/* ---- vertical flight-descent rail: scroll down = fly down the page --- */
.flight-descent { display: none; }
@media (min-width: 1080px) and (prefers-reduced-motion: no-preference) {
  .flight-descent {
    position: fixed; z-index: 120; top: 0; right: 26px; width: 26px; height: 100vh;
    display: block; pointer-events: none;
  }
}
.flight-descent .fd-track { position: absolute; top: 15vh; bottom: 15vh; left: 50%; width: 1.5px; transform: translateX(-50%); background: linear-gradient(180deg, rgba(20, 20, 19, .06), rgba(20, 20, 19, .16), rgba(20, 20, 19, .06)); }
.flight-descent .fd-fill { position: absolute; top: 15vh; left: 50%; width: 1.5px; height: 0; transform: translateX(-50%); background: linear-gradient(180deg, #a9c8ef, var(--clay)); box-shadow: 0 0 10px rgba(69, 116, 204, .5); }
.flight-descent .fd-tick { position: absolute; left: 50%; width: 6px; height: 6px; border-radius: 50%; transform: translate(-50%, -50%); background: var(--paper); border: 1.5px solid rgba(20, 20, 19, .22); transition: background .3s ease, border-color .3s ease, transform .3s ease; }
.flight-descent .fd-tick.lit { background: var(--blue); border-color: var(--blue); transform: translate(-50%, -50%) scale(1.15); }
/* the rail flies downward, so the plane silhouette is nose-down */
/* nose points down — it descends the page as you scroll (the glyph is drawn
   nose-down, so no rotation) */
.flight-descent .fd-plane { position: absolute; left: 50%; top: 15vh; width: 22px; height: 22px; transform: translate(-50%, -50%); color: var(--clay); filter: drop-shadow(0 2px 5px rgba(69, 116, 204, .4)); }
.flight-descent .fd-plane svg { width: 100%; height: 100%; fill: currentColor; }

/* ---- hero: directional scroll cue at the fold ------------------------ */
.hero-scroll-cue {
  position: absolute; z-index: 3; left: max(40px, calc((100vw - var(--max)) / 2)); bottom: 26px;
  display: inline-flex; align-items: center; gap: 10px;
  color: rgba(20, 20, 19, .45); font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase;
  transition: opacity .4s ease;
}
.hero-scroll-cue svg { width: 18px; height: 18px; stroke: var(--clay); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-reduced-motion: no-preference) {
  .hero-scroll-cue svg { animation: cue-bob 1.9s ease-in-out infinite; }
}
@keyframes cue-bob { 0%, 100% { transform: translateY(0); opacity: .45; } 50% { transform: translateY(5px); opacity: 1; } }

/* The highlighted hero phrase is flat --clay (see .hero-copy h1 em above).
   It carried an animated white shine sweep here; removed on purpose — animating
   background-position on a background-clip:text element cannot be composited, so
   it repainted the whole headline every frame. Don't add it back. */

/* ---- how-it-works: the flight plan draws itself in ------------------- */
.flight-steps .steps-track-fill {
  position: absolute; top: 5px; left: 14px; right: 14px; height: 0;
  border-top: 1.5px solid var(--blue);
  transform: scaleX(0); transform-origin: left center; opacity: .9;
}
.flight-steps.drawn .steps-track-fill { transform: scaleX(1); transition: transform 1.1s cubic-bezier(.16, 1, .3, 1) .15s; }
.flight-steps .node { transition: background .35s ease, box-shadow .35s ease, transform .35s ease; }
.flight-steps li.lit .node { background: var(--clay); box-shadow: 0 0 0 5px rgba(69, 116, 204, .16); transform: scale(1.12); }
/* Narrow screens stack the steps, so the drawn track has to run down the
   gutter instead of across the top — otherwise the blue line strikes through
   "STEP 1". Declared after the base rule so it wins without !important. */
@media (max-width: 820px) {
  .flight-steps li { padding-left: 38px; }
  .flight-steps li::before { top: 18px; bottom: -34px; left: 5px; }
  .flight-steps .node { top: 5px; }
  /* The drawn fill spans the whole list, which only reads correctly when the
     track is horizontal — stacked, it would overshoot well past the last node.
     Drop it and let each dashed connector turn blue as its step lights up. */
  .flight-steps .steps-track-fill { display: none; }
  .flight-steps li::before { transition: border-color .45s ease; }
  .flight-steps li.lit::before { border-left-color: var(--clay); }
}

/* ---- spotlight glow that follows the cursor on dark cards ------------ */
.featured-art, .featured-more { position: relative; overflow: hidden; }
.featured-art::after, .featured-more::after {
  content: ""; position: absolute; inset: 0; z-index: 0; opacity: 0; transition: opacity .3s ease;
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .28), transparent 42%);
}
.featured-primary:hover .featured-art::after,
.featured-more:hover::after { opacity: 1; }
.featured-more > * { position: relative; z-index: 1; }

/* ---- closing CTA band: slow ambient drift fills the empty space ------ */
.cta-band { position: relative; overflow: hidden; }
.cta-band > * { position: relative; z-index: 1; }
@media (prefers-reduced-motion: no-preference) {
  .cta-band::before {
    content: ""; position: absolute; z-index: 0; inset: -40%;
    background:
      radial-gradient(38% 42% at 28% 30%, rgba(69, 116, 204, .34), transparent 60%),
      radial-gradient(34% 40% at 74% 68%, rgba(69, 116, 204, .14), transparent 62%);
    animation: cta-drift 22s ease-in-out infinite alternate;
  }
}
@keyframes cta-drift { from { transform: translate3d(-4%, -3%, 0) scale(1); } to { transform: translate3d(5%, 4%, 0) scale(1.12); } }

/* RTL: cue anchors to the right edge */
[dir="rtl"] .hero-scroll-cue { left: auto; right: max(40px, calc((100vw - var(--max)) / 2)); }
/* only meaningful while the steps run horizontally; below 820px the track is
   vertical and keeps its top origin for both directions */
@media (min-width: 821px) {
  [dir="rtl"] .flight-steps .steps-track-fill { transform-origin: right center; }
}

/* ==========================================================================
   6. LEARNING VIEW — responsive
   These deliberately live at the end of the file. Section 4 sets the desktop
   grids and, being later in the cascade than the shared breakpoint blocks
   above, it used to win on phones — which is why case pages rendered with the
   sidebar column still in place and the article pushed off-screen.
   ========================================================================== */
@media (max-width: 1050px) {
  .lesson-content { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .lesson-aside { display: none; }
  .deliverable-grid { grid-template-columns: repeat(2, 1fr); }
  .run-panel, .tools-in-case { grid-template-columns: minmax(0, 1fr); }
  .artifact-list { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  /* shell: sidebar becomes a slide-in drawer behind the "Contents" bar */
  .learning-shell { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .course-sidebar {
    position: fixed; z-index: 120; top: var(--header-height); bottom: 0; left: 0;
    width: min(330px, 86vw); height: auto;
    box-shadow: 18px 0 40px rgba(12, 20, 45, .18);
    transform: translateX(-100%); transition: transform .22s ease;
  }
  body.course-nav-open .course-sidebar { transform: translateX(0); }
  .course-menu-toggle {
    position: sticky; z-index: 80; top: var(--header-height);
    display: flex; justify-content: space-between; align-items: center;
    width: 100%; padding: 13px 20px;
    border: 0; border-bottom: 1px solid var(--line);
    background: #fff; color: var(--ink);
    font: inherit; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  }

  /* article */
  .lesson-content { padding: 26px 20px 80px; }
  .lesson-article h1 { margin: 16px 0 18px; font-size: clamp(30px, 8.4vw, 44px); letter-spacing: -.04em; }
  .lesson-labels span { font-size: 9px; }
  .lesson-intro { margin-bottom: 30px; font-size: 15px; }
  .lesson-section { margin-bottom: 46px; }
  .lesson-section > h2, .tools-in-case h2, .results-heading h2 { font-size: 24px; }

  /* every desktop multi-column block collapses to one column */
  .case-brief dl { grid-template-columns: repeat(2, 1fr); }
  .case-brief dl div { border-bottom: 1px solid var(--line); }
  .case-brief dl div:nth-child(2n) { border-right: 0; }
  .case-brief dl div:nth-last-child(-n+2) { border-bottom: 0; }
  .learning-objectives { grid-template-columns: minmax(0, 1fr); }
  .learning-objectives div { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .learning-objectives div:last-child { border-bottom: 0; }
  .learning-objectives p { margin-top: 14px; }
  .method-flow { grid-template-columns: minmax(0, 1fr); }
  .method-flow > div { min-height: 0; }
  .method-flow > b { justify-self: center; transform: rotate(90deg); }
  .method-flow span { margin-bottom: 10px; }
  .demo-chain, .prompt-notes, .deliverable-grid,
  .proposal-option-table, .proposal-notes-grid { grid-template-columns: minmax(0, 1fr); }
  .demo-chain article, .deliverable-grid article,
  .proposal-option-table article, .proposal-notes-grid article { min-height: 0; }
  .deliverable-grid h3 { margin-top: 16px; }
  .prompt-notes p, .proposal-notes-grid p { margin-top: 14px; }
  .proposal-option-table article { border-right: 0; border-bottom: 1px solid var(--line); }
  .proposal-option-table article:last-child { border-bottom: 0; }
  .proposal-option-table strong { margin-top: 14px; }
  .proposal-notes-grid article { border-right: 0; border-bottom: 1px solid var(--line); }
  .proposal-notes-grid article:last-child { border-bottom: 0; }
  .proposal-preview-heading { padding: 20px; }
  .proposal-preview-heading h3 { font-size: 21px; }

  .tools-in-case { gap: 24px; padding: 26px 20px; }
  .run-panel { gap: 24px; padding: 22px 18px; }
  .prompt-package pre { padding: 16px; font-size: 10.5px; }
  .lesson-next { flex-direction: column; align-items: flex-start; gap: 18px; margin-top: 50px; }
  .lesson-next button { width: 100%; justify-content: space-between; }
  .results-heading { flex-direction: column; align-items: flex-start; gap: 12px; }
  #refresh-artifacts-button { width: 100%; }
}
