  /* Fonts: SIL OFL 1.1, self-hosted (licenses in fonts/) */
  @font-face { font-family: "Instrument Serif"; src: url("fonts/instrument-serif-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
  @font-face { font-family: "Instrument Serif"; src: url("fonts/instrument-serif-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
  @font-face { font-family: "Outfit"; src: url("fonts/outfit-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

  :root {
    --night: #16233f;      /* hero, dark surfaces */
    --ink: #20325a;        /* Mon Espérance navy: headings, links */
    --sky: #dce7f3;        /* pale sky: frames, tags */
    --paper: #fafbfd;      /* page */
    --white: #ffffff;
    --dawn: #f2b544;       /* dawn gold: the route, markers only */
    --dawn-deep: #9a6a0c;  /* gold on light backgrounds (contrast) */
    --text: #1f2738;
    --slate: #4a5468;      /* secondary text */
    --rule: #d9e1ec;
    --ok: #1f6b45;
    --warn: #8a3a14;
    --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
    --sans: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  }
  @media (prefers-color-scheme: dark) {
    :root {
      --paper: #0f1729; --white: #16213a; --text: #e7ecf5; --slate: #aab4c7; --rule: #2a3754;
      --ink: #b8cbef; --sky: #22325a; --dawn-deep: #f2b544; --ok: #8fd8b0; --warn: #f5b596;
    }
  }

  * { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  @media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
  body { margin: 0; background: var(--paper); color: var(--text); font: 400 17.5px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
  a { color: var(--ink); text-underline-offset: 3px; }
  :focus-visible { outline: 3px solid var(--dawn); outline-offset: 3px; border-radius: 4px; }
  img { max-width: 100%; }
  strong { font-weight: 600; }

  /* ---------- Hero: the night and the dawn route ---------- */
  .hero { background: radial-gradient(120% 90% at 85% 110%, #2c3f6b 0%, var(--night) 55%); color: #eef3fb; padding: 72px 24px 64px; }
  .hero-inner { max-width: 1180px; margin: 0 auto; }
  .brand { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; color: #c9d6ec; font-size: 15px; margin: 0 0 40px; }
  .brand b { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 26px; color: #fff; }
  .hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(44px, 7.4vw, 96px); line-height: .98; letter-spacing: -.01em; margin: 0; max-width: 13ch; }
  .hero .intro { font-size: 19px; line-height: 1.6; color: #cfdaee; max-width: 56ch; margin: 26px 0 0; }

  .route { list-style: none; margin: 64px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); position: relative; }
  .route::before { content: ""; position: absolute; left: 10%; right: 10%; top: 17px; height: 3px; border-radius: 3px;
    background: linear-gradient(90deg, rgba(242,181,68,.25), var(--dawn) 60%, #ffd98a);
    transform-origin: left; animation: draw 1.6s cubic-bezier(.6,.1,.2,1) .2s both; }
  @keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  @keyframes drawv { from { transform: scaleY(0); } to { transform: scaleY(1); } }
  .route li { text-align: center; padding: 0 8px; position: relative; }
  .route .dot { display: block; width: 36px; height: 36px; margin: 0 auto 14px; border-radius: 50%; background: var(--night); border: 3px solid var(--dawn); position: relative; z-index: 1; }
  .route li:last-child .dot { background: var(--dawn); box-shadow: 0 0 0 8px rgba(242,181,68,.18), 0 0 40px rgba(242,181,68,.55); }
  .route strong { display: block; font-weight: 500; color: #fff; font-size: 16px; line-height: 1.3; }
  .route span { display: block; font-size: 14px; color: #a9b8d3; margin-top: 4px; line-height: 1.4; }
  .hero .tap { margin: 48px 0 0; font-size: 15px; color: #a9b8d3; }

  /* ---------- Top chapter bar ---------- */
  .chapters { position: sticky; top: 0; z-index: 20; background: rgba(250,251,253,.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); }
  @media (prefers-color-scheme: dark) { .chapters { background: rgba(15,23,41,.9); } }
  .chapters ul { list-style: none; margin: 0 auto; padding: 0 16px; max-width: 1180px; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
  .chapters ul::-webkit-scrollbar { display: none; }
  .chapters a { display: block; white-space: nowrap; padding: 14px 12px; font-size: 15px; color: var(--slate); text-decoration: none; border-bottom: 2px solid transparent; }
  .chapters a:hover { color: var(--ink); border-bottom-color: var(--dawn); }

  /* ---------- Chapters ---------- */
  main { max-width: 1180px; margin: 0 auto; padding: 0 24px 96px; }
  .chapter { padding: 88px 0 8px; scroll-margin-top: 48px; }
  .chapter + .chapter { border-top: 1px solid var(--rule); }
  .chapter > header { display: grid; gap: 14px; margin-bottom: 30px; max-width: 760px; }
  .chapter h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(38px, 5vw, 60px); line-height: 1.02; margin: 0; color: var(--ink); letter-spacing: -.005em; }
  .lede { font-size: 20px; line-height: 1.55; color: var(--slate); margin: 0; max-width: 60ch; }
  .prose { max-width: 70ch; }
  .prose p { margin: 12px 0; }
  h3 { font-family: var(--serif); font-weight: 400; font-size: 31px; line-height: 1.15; color: var(--ink); margin: 56px 0 12px; }
  .pair h3 { margin-top: 0; }

  /* ---------- Screenshot frames ---------- */
  figure.shot { margin: 30px 0 40px; }
  .frame { display: block; width: 100%; padding: 0; border: 1px solid var(--rule); border-radius: 14px; overflow: hidden; background: var(--white); cursor: zoom-in; text-align: left; font: inherit; color: inherit;
    box-shadow: 0 1px 0 rgba(22,35,63,.04), 0 24px 48px -24px rgba(22,35,63,.35); transition: transform .2s ease, box-shadow .2s ease; }
  .frame:hover { transform: translateY(-2px); box-shadow: 0 1px 0 rgba(22,35,63,.04), 0 30px 56px -24px rgba(22,35,63,.45); }
  .bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--sky); border-bottom: 1px solid var(--rule); font-size: 14px; color: var(--ink); }
  .bar .where { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-weight: 500; }
  .bar .where i { font-style: normal; color: var(--slate); }
  .bar .zoom { margin-left: auto; color: var(--slate); font-size: 13px; white-space: nowrap; }
  .frame img { display: block; width: 100%; height: auto; }
  figure.shot figcaption { margin: 14px 2px 0; font-size: 16px; line-height: 1.55; color: var(--slate); max-width: 78ch; }
  figure.shot figcaption strong { color: var(--text); }
  .open { display: inline-flex; align-items: center; gap: 6px; margin: 12px 2px 0; font-size: 15px; font-weight: 500; color: var(--ink); background: var(--sky); border-radius: 999px; padding: 6px 14px; text-decoration: none; }
  .open:hover { background: var(--dawn); color: var(--night); }
  .open::after { content: ""; width: 9px; height: 9px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg) translate(-1px, 1px); }
  .open + figcaption { margin-top: 10px; }
  .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; margin: 30px 0; }
  .pair figure.shot { margin: 0; }

  /* ---------- Before / after ledger ---------- */
  .ledger { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: 16px; overflow: hidden; margin: 8px 0 36px; }
  .ledger div { background: var(--white); padding: 24px 22px; }
  .ledger .num { font-family: var(--serif); font-size: 58px; line-height: 1; color: var(--ink); display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
  .ledger .num s { font-size: 30px; color: var(--slate); text-decoration-thickness: 2px; text-decoration-color: var(--dawn); }
  .ledger p { margin: 10px 0 0; font-size: 15.5px; color: var(--slate); line-height: 1.5; }

  .done { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
  .done li { display: grid; grid-template-columns: 200px 1fr; gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
  .done li b { font-weight: 600; color: var(--ink); }

  /* ---------- The four-step system (a real sequence) ---------- */
  .steps4 { list-style: none; counter-reset: s; margin: 10px 0 24px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
  .steps4 li { counter-increment: s; border-top: 3px solid var(--dawn); padding-top: 16px; }
  .steps4 li::before { content: counter(s); font-family: var(--serif); font-size: 44px; line-height: 1; color: var(--ink); display: block; margin-bottom: 10px; }
  .steps4 b { display: block; font-weight: 600; font-size: 18px; margin-bottom: 6px; }
  .steps4 span { color: var(--slate); font-size: 16px; line-height: 1.5; }

  /* ---------- Notes ---------- */
  .note { border-left: 3px solid var(--dawn-deep); padding: 4px 0 4px 20px; margin: 26px 0; max-width: 74ch; }
  .note.ok { border-left-color: var(--ok); }
  .note.warn { border-left-color: var(--warn); }
  .note h4 { margin: 0 0 4px; font-size: 16px; font-weight: 600; color: var(--ink); }
  .note.ok h4 { color: var(--ok); }
  .note.warn h4 { color: var(--warn); }
  .note p, .note ul { margin: 4px 0; }
  .note ul { padding-left: 20px; }
  .note li { margin: 4px 0; }

  /* ---------- Tables ---------- */
  .table { overflow-x: auto; margin: 22px 0 30px; border-top: 2px solid var(--ink); }
  table { border-collapse: collapse; width: 100%; font-size: 16px; }
  th { text-align: left; font-weight: 600; font-size: 14px; color: var(--slate); padding: 12px 14px 10px 0; border-bottom: 1px solid var(--rule); }
  td { padding: 13px 14px 13px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
  td:first-child { font-weight: 500; color: var(--ink); min-width: 190px; }
  .tag { display: inline-block; font-size: 14px; font-weight: 500; color: var(--ink); background: var(--sky); border-radius: 999px; padding: 1px 10px; margin: 2px 2px 2px 0; white-space: nowrap; }
  .path { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
  .path b { font-weight: 600; color: var(--ink); background: var(--sky); border-radius: 6px; padding: 0 8px; }
  .path i { font-style: normal; color: var(--slate); }

  /* ---------- Bible workflow as a route ---------- */
  .wf { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 40px; align-items: start; margin-top: 10px; }
  .wf ol { list-style: none; margin: 0; padding: 0 0 0 30px; position: relative; }
  .wf ol::before { content: ""; position: absolute; left: 9px; top: 12px; bottom: 12px; width: 2px; background: linear-gradient(var(--rule), var(--dawn)); }
  .wf li { position: relative; padding: 0 0 22px; }
  .wf li::before { content: ""; position: absolute; left: -27px; top: 7px; width: 14px; height: 14px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); }
  .wf li.start::before { background: var(--ink); }
  .wf li.end::before { background: var(--dawn); border-color: var(--dawn); box-shadow: 0 0 0 5px rgba(242,181,68,.25); }
  .wf li b { display: block; font-weight: 600; }
  .wf li span { display: block; color: var(--slate); font-size: 15.5px; }
  .wf .fork { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
  .wf .fork div { background: var(--white); border: 1px solid var(--rule); border-radius: 10px; padding: 10px 12px; font-size: 15px; }
  .wf figure.shot { margin: 0; }

  /* ---------- Numbered how-to ---------- */
  ol.howto { counter-reset: h; list-style: none; padding: 0; margin: 16px 0 30px; max-width: 72ch; }
  ol.howto li { counter-increment: h; display: grid; grid-template-columns: 40px 1fr; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
  ol.howto li::before { content: counter(h); font-family: var(--serif); font-size: 28px; line-height: 1; color: var(--dawn-deep); }

  /* ---------- Possibilities ---------- */
  .options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: 16px; overflow: hidden; margin: 10px 0 34px; }
  .options div { background: var(--white); padding: 22px; }
  .options b { display: block; font-family: var(--serif); font-weight: 400; font-size: 25px; line-height: 1.15; color: var(--ink); margin-bottom: 8px; }
  .options p { margin: 0; color: var(--slate); font-size: 16px; line-height: 1.5; }
  .options em { display: inline-block; margin-top: 12px; font-style: normal; font-size: 14px; font-weight: 500; color: var(--dawn-deep); }
  .options em.ready { color: var(--ok); }

  /* ---------- Rules ---------- */
  .rules { list-style: none; margin: 10px 0 0; padding: 0; columns: 2 320px; column-gap: 48px; }
  .rules li { break-inside: avoid; padding: 14px 0 14px 34px; border-bottom: 1px solid var(--rule); position: relative; }
  .rules li::before { content: ""; position: absolute; left: 4px; top: 22px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--dawn-deep); }

  footer { max-width: 1180px; margin: 0 auto; padding: 40px 24px 64px; border-top: 1px solid var(--rule); color: var(--slate); font-size: 15px; }

  /* ---------- Lightbox ---------- */
  dialog.lightbox { border: 0; padding: 0; margin: 0; width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; background: rgba(12,19,36,.96); color: #fff; }
  dialog.lightbox::backdrop { background: rgba(12,19,36,.96); }
  .lightbox .scroller { width: 100%; height: 100%; overflow: auto; display: block; text-align: center; padding: 64px 12px 28px; }
  .lightbox img { display: inline-block; vertical-align: top; max-width: none; width: min(1700px, 190vw); height: auto; border-radius: 10px; }
  @media (min-width: 900px) { .lightbox img { width: min(1700px, 96vw); } }
  .lightbox .close { position: fixed; top: 14px; right: 14px; font: 600 16px/1 var(--sans); background: var(--dawn); color: var(--night); border: 0; border-radius: 999px; padding: 12px 18px; cursor: pointer; }
  .lightbox .cap { position: fixed; top: 20px; left: 18px; right: 140px; margin: 0; font-size: 15px; color: #cfdaee; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* ---------- Responsive ---------- */
  @media (max-width: 900px) {
    .pair, .wf { grid-template-columns: 1fr; }
    .ledger { grid-template-columns: 1fr; }
    .steps4 { grid-template-columns: 1fr 1fr; }
    .options { grid-template-columns: 1fr 1fr; }
    .done li { grid-template-columns: 1fr; gap: 4px; }
  }
  @media (max-width: 640px) {
    body { font-size: 17px; }
    .hero { padding: 48px 16px 44px; }
    main { padding: 0 16px 72px; }
    .chapter { padding-top: 64px; }
    .route { grid-template-columns: 1fr; margin-top: 44px; }
    .route::before { left: 17px; right: auto; top: 18px; bottom: 40px; width: 3px; height: auto; transform-origin: top;
      background: linear-gradient(180deg, rgba(242,181,68,.25), var(--dawn) 60%, #ffd98a); animation-name: drawv; }
    .route li { display: grid; grid-template-columns: 36px 1fr; column-gap: 16px; text-align: left; padding: 0 0 22px; }
    .route .dot { margin: 0; grid-row: span 2; }
    .steps4, .options { grid-template-columns: 1fr; }
    .wf .fork { grid-template-columns: 1fr; }
    .bar .zoom { display: none; }
    .frame { border-radius: 10px; }
  }
  @media print {
    .chapters, dialog { display: none !important; }
    .hero { background: #fff; color: #000; }
    .frame { box-shadow: none; }
  }

  /* ---------- Language switch (sliding) ---------- */
  .chapters .inner { max-width: 1180px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 12px; }
  .chapters .inner ul { flex: 1; min-width: 0; padding: 0; margin: 0; max-width: none; }
  .lang { position: fixed; top: 10px; right: 14px; z-index: 50; box-shadow: 0 6px 20px -6px rgba(12,19,36,.45); display: grid; grid-template-columns: repeat(3, 44px); background: var(--sky); border-radius: 999px; padding: 3px; }
  .lang a { position: relative; z-index: 1; text-align: center; font-size: 14px; font-weight: 600; letter-spacing: .02em; color: var(--ink); text-decoration: none; padding: 6px 0; border-radius: 999px; transition: color .25s ease; }
  .lang a[aria-current="page"] { color: #fff; }
  .lang .thumb { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 3px; width: 44px; border-radius: 999px; background: var(--ink); transition: transform .3s cubic-bezier(.4,.1,.2,1); }
  .lang[data-active="1"] .thumb { transform: translateX(44px); }
  .lang[data-active="2"] .thumb { transform: translateX(88px); }
  .lang.moving .thumb { transition-duration: .3s; }
  @media (prefers-color-scheme: dark) { .lang a[aria-current="page"] { color: #0f1729; } }

  /* Keep the chapter links clear of the fixed language switch */
  .chapters .inner { padding-right: 170px; }
  @media (max-width: 640px) {
    .chapters .inner { padding-right: 158px; }
    .lang { right: 10px; }
  }
  @media print { .lang { display: none; } }
