From d9219c5d709a5d77dfa3a49ef246998c243ca946 Mon Sep 17 00:00:00 2001 From: Ken Okamoto Date: Thu, 13 Aug 2026 16:18:02 +0900 Subject: [PATCH] Replace the SaaS landing with a protocol page. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The page is the gated loop: claim ledger → engine → semantic → 15-criteria → adversarial → correction, with a visible 5→2 return. No cream, kickers, Replay, or star CTAs. --- docs/index.html | 278 ++++++++++------ docs/ja/index.html | 278 ++++++++++------ docs/site/css/style.css | 675 +++++++++++++++++---------------------- docs/site/css/tokens.css | 52 +-- docs/site/js/main.js | 189 ++--------- 5 files changed, 710 insertions(+), 762 deletions(-) diff --git a/docs/index.html b/docs/index.html index a9d9b1a..3f1e842 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,91 +1,189 @@ - - -Evidentia — Catch fabricated citations before you publish - - - - - - - - - - - - - -

Citation verifier · CLI · MCP · Skill · v1.1.0 MIT

-

Catch fabricated citations
before you publish.

-

Deterministic registry checks against CrossRef, PubMed, OpenAlex, arXiv, and ClinicalTrials.gov. A 4-tier verdict — Verified, bibliographic mismatch, hallucination, or content review needed. Not a vibes checker. No API key.

-

Install in 60 seconds ★ Star on GitHub

-

Engine: npx evidentia check · Skill: npx skills add kgraph57/evidentia

npx · evidentia check
-
$ npx evidentia check examples/inputs/ai-generated-answer.md
- 
-Evidentia: 4 citations — 1 verified, 1 mismatch, 2 hallucinated (75.0% fabrication rate)
-  [OK ] doi:10.1136/bmj.i6583       — Paper exists and the cited metadata matches the registry record.
-  [HAL] doi:10.1056/nejmoa2105512   — DOI does not resolve in CrossRef or OpenAlex, and no matching paper was found.
-  [HAL] pmid:18768876               — Identifier resolves to a different paper than the one cited.
-  [MIS] doi:10.1002/14651858.cd012734 — Paper exists, but cited metadata disagrees with the record (year).
-

Committed example — vitamin D / childhood infections. Four citations, one real.

-
Why now -

Fabricated references are no longer rare

-

A Lancet audit (Topaz et al., 2026) of biomedical papers found fabricated references in 1 in 2,828 papers in 2023, 1 in 458 in 2025 (about sixfold), and 1 in 277 in the first 7 weeks of 2026 — about a 10-fold rise from 2023, in step with AI writing tools. A fabricated DOI looks exactly like a real one. Evidentia resolves each identifier and tells you which is which.

Topaz et al., Lancet 2026;407(10541):1779–1781. doi:10.1016/S0140-6736(26)00603-3 · STAT, 7 May 2026 · PMC open-access subset
-
4-tier classification -

Not 'could not verify.' A reason.

-

Most citation checkers stop at a shrug. Evidentia resolves the identifier and says why a citation is suspect.

-

[OK] Verified

The paper exists and the cited title, authors, year, and journal match the registry record.

-

[REV] Content review needed

Registries cannot confirm it (book, guideline, title-only), or a real paper still needs a human or LLM to check whether it is used in the right context.

-

[MIS] Bibliographic mismatch

A real paper exists, but the DOI/PMID is wrong or the metadata disagrees — careless citation, or a fabricated identifier bolted onto a real title.

-

[HAL] Hallucination

The identifier resolves to nothing, or to a completely different paper. The signature of AI-generated text.

-
Two layers -

A computer that does not guess, plus a skill that judges

-

Split on purpose: existence is deterministic. Honesty of use still needs judgment.

-
Engine · CLI + MCP -

Does this paper exist?

-

Pure registry lookup. DOI, PMID, arXiv, NCT vs CrossRef, PubMed, OpenAlex, arXiv, ClinicalTrials.gov. No API key, no LLM, no hallucination of its own.

-

npx evidentia check · claude mcp add evidentia -- npx -y evidentia-mcp

Skill · four loops -

Is it used honestly?

-

Claim ledger, then four named loops: engine, semantic, adversarial, correction. The 15-criteria rubric is one pass inside that pipeline. KILL or MAJOR cannot ship as A.

-

npx skills add kgraph57/evidentia

-
How the skill actually verifies -

Claim ledger first. Four loops. KILL is a feature.

-

The 15-criteria rubric is one pass inside the pipeline, not the product. Existence is the engine. Honesty is the skill. A fabricated DOI presented as real is a KILL — overall ≤ D, F if fabrication. That is the system working.

-
01 · Engine -

Does it exist?

-

Registry lookup. Retry once if unreachable; then unresolved, never a guessed hallucination.

-
02 · Semantic -

Is the real paper used honestly?

-

One extra abstract lookup per Tier 1 cite. Primary outcome, population, direction of effect. Does not upgrade a T3 or T4.

-
03 · Adversarial -

KILL is a feature

-

Five lenses. KILL / MAJOR / MINOR / PASS. KILL or MAJOR cannot ship as A. Max 3 passes.

-
04 · Correction -

Revise, then re-enter from the engine

-

Cap 3. Then stop and report what is still open. Do not raise the letter while a T4 remains.

-

Worked example: vitamin D — claim ledger → engine → semantic → KILL.

-
60-second start -

Three ways in. CLI first.

-

No API key. MIT. Pick the path that matches how you write.

-
01

CLI — no install

# one-off, no API key
-$ npx evidentia check your-article.md
-
02

Agent skill

Works because SKILL.md lives at skills/medical-fact-check/SKILL.md.

# Claude Code, Cursor, Codex, and other agents that load skills
-$ npx skills add kgraph57/evidentia
-
03

Claude plugin

$ /plugin marketplace add kgraph57/evidentia
-$ /plugin install evidentia@evidentia
-

MCP, if you want the engine inside any agent: claude mcp add evidentia -- npx -y evidentia-mcp

-

Evidentia is a pre-publication aid for writers, editors, and researchers — not clinical decision support. It does not diagnose, treat, or replace professional medical judgment.

- - + + + + + Evidentia — How quality is gated + + + + + + + + + + + + + + +
+
+ Evidentia + +
+
+
+
+
+

How quality is gated

+

Evidentia is a protocol for medical writing before it is published. Quality is guaranteed by a gated loop, not by a scoring rubric. Existence is a registry lookup. Honesty is a skill. A fabricated identifier presented as real is a KILL.

+

CLI + MCP engine · skills/medical-fact-check · MIT · not CDS

+
+
+

flow

+
    +
  1. + +

    content

    +
  2. +
  3. + +
    +

    Claim ledger

    +
    +
    +
    check
    +
    Extract every testable claim and its identifier before any lookup. Headlines count.
    +
    +
    +
    stop
    +
    Do not call the engine until the ledger exists.
    +
    +
    +
    +
  4. +
  5. + +
    +

    Engine

    +
    +
    +
    check
    +
    Existence: DOI / PMID / arXiv / NCT against CrossRef, PubMed, OpenAlex, arXiv, ClinicalTrials.gov.
    +
    +
    +
    fail
    +
    Retry once; still down → unresolved (never guess Hallucination). T4 is ground truth — the LLM must not override. ISBN / guideline / title-only → T2, never T4.
    +
    +
    +
    +
  6. +
  7. + +
    +

    Semantic

    +
    +
    +
    check
    +
    Honesty: one abstract fetch per T1 cite; primary outcome, population, direction of effect.
    +
    +
    +
    fail
    +
    Does not upgrade T3 or T4.
    +
    +
    +
    +
  8. +
  9. + +
    +

    15-criteria

    +
    +
    +
    check
    +
    Appraisal of the content (not a treatment recommendation).
    +
    +
    +
    stop
    +
    This pass does not diagnose, treat, or replace professional judgment.
    +
    +
    +
    +
  10. +
  11. + +
    +

    Adversarial

    +
    +
    +
    check
    +
    Five lenses plus a 10-line checklist → KILL / MAJOR / MINOR / PASS.
    +
    +
    +
    fail
    +
    KILL (T4 presented as real, or harm) → score ≤ D (F if fabrication). MAJOR cannot be A.
    +
    +
    +

    loop 5 → 2 Engine · cap 3

    +
    +
  12. +
  13. + +
    +

    Correction

    +
    +
    +
    check
    +
    The author revises the text.
    +
    +
    +
    stop
    +
    Re-enter at 2 Engine. Cap 3. Then stop and report what is still open.
    +
    +
    +
    +
  14. +
+
+ +
+

run

+
+
$ npx evidentia check examples/inputs/ai-generated-answer.md
+
+Evidentia: 4 citations — 1 verified, 1 mismatch, 2 hallucinated (75.0% fabrication rate)
+  [OK ] doi:10.1136/bmj.i6583       — Paper exists and the cited metadata matches the registry record.
+  [HAL] doi:10.1056/nejmoa2105512   — DOI does not resolve in CrossRef or OpenAlex, and no matching paper was found.
+  [HAL] pmid:18768876               — Identifier resolves to a different paper ("Trafficking of antigen-specific
+                                       CD8+ T lymphocytes…") than the one cited.
+  [MIS] doi:10.1002/14651858.cd012734 — Paper exists, but cited metadata disagrees with the record (year).
+
+

+ Committed vitamin D run. Four citations; one real. The Cochrane DOI stays T3. + Case study: claim ledger → engine → semantic → KILL. +

+
+
+

install

+
+ +
npx evidentia check your-article.md
+npx skills add kgraph57/evidentia
+
+
+ +
+
+ + + + diff --git a/docs/ja/index.html b/docs/ja/index.html index d1cbddb..c480421 100644 --- a/docs/ja/index.html +++ b/docs/ja/index.html @@ -1,91 +1,189 @@ - - -Evidentia — 捏造引用を、公開前に捕まえる - - - - - - - - - - - - - -

引用検証 · CLI · MCP · Skill · v1.1.0 MIT

-

捏造引用を、
公開前に捕まえる。

-

CrossRef、PubMed、OpenAlex、arXiv、ClinicalTrials.gov への決定論的なレジストリ照合。判定は4段階 — 検証済み、書誌の不一致、ハルシネーション、内容レビューが必要。雰囲気で「怪しい」と言うチェッカーではない。APIキー不要。

-

60秒で始める ★ GitHubでStar

-

エンジン: npx evidentia check · スキル: npx skills add kgraph57/evidentia

npx · evidentia check
-
$ npx evidentia check examples/inputs/ai-generated-answer.md
- 
-Evidentia: 4 citations — 1 verified, 1 mismatch, 2 hallucinated (75.0% fabrication rate)
-  [OK ] doi:10.1136/bmj.i6583       — Paper exists and the cited metadata matches the registry record.
-  [HAL] doi:10.1056/nejmoa2105512   — DOI does not resolve in CrossRef or OpenAlex, and no matching paper was found.
-  [HAL] pmid:18768876               — Identifier resolves to a different paper than the one cited.
-  [MIS] doi:10.1002/14651858.cd012734 — Paper exists, but cited metadata disagrees with the record (year).
-

収録の実行例 — ビタミンDと小児感染症。引用4件のうち、実在は1件。

-
なぜ今か -

捏造文献は、もう珍しくない

-

生物医学論文を対象にした Lancet の監査(Topaz et al., 2026)では、捏造文献は 2023年は2,828本に1本、2025年は458本に1本(約6倍)、2026年最初の7週間は277本に1本。2023年比で約10倍で、生成AIライティングの普及と時期が重なる。捏造DOIは本物と見分けがつかない。Evidentia は識別子を一つずつ解決して、どれが本物かを示す。

Topaz et al., Lancet 2026;407(10541):1779–1781. doi:10.1016/S0140-6736(26)00603-3 · STAT、2026年5月7日 · PMCオープンアクセス収載分
-
4段階分類 -

「検証できませんでした」で終わらない。理由を出す。

-

多くの引用チェッカーはそこで止まる。Evidentia は識別子を解決し、なぜ怪しいのかを示す。

-

[OK] 検証済み

論文は実在し、引用のタイトル・著者・年・誌名がレジストリ記録と一致する。

-

[REV] 内容レビューが必要

レジストリでは確定できない(書籍・ガイドライン・タイトルのみ)、または実在論文でも、正しい文脈で使われているかの確認が人間かLLMに残る。

-

[MIS] 書誌の不一致

実在する論文だが、DOI/PMID が誤っているかメタデータが食い違う。雑な引用か、本物のタイトルに捏造識別子を付けたもの。

-

[HAL] ハルシネーション

識別子が何も解決しない、またはまったく別の論文を指す。AI生成テキストの典型。

-
2層構成 -

推測しないエンジンと、判断するスキル

-

分けているのは意図的。存在の確認は決定論。使い方の誠実さには判断が要る。

-
エンジン · CLI + MCP -

この論文は実在するか

-

純粋なレジストリ照合。DOI / PMID / arXiv / NCT を CrossRef、PubMed、OpenAlex、arXiv、ClinicalTrials.gov へ。APIキー不要、LLMなし、エンジン自身はハルシネーションしない。

-

npx evidentia check · claude mcp add evidentia -- npx -y evidentia-mcp

スキル · 4ループ -

正しく使われているか

-

まず主張台帳。つづいてエンジン、意味、敵対、修正の4ループ。15項目はその中の一工程。KILL または MAJOR は A では出せない。

-

npx skills add kgraph57/evidentia

-
スキルの検証の仕方 -

まず主張台帳。ループは4つ。KILL は仕様。

-

15項目のルーブリックはパイプラインの中の一工程であって、商品そのものではない。存在はエンジン、誠実さはスキル。実在として出した捏造DOIは KILL — 総合 ≤ D、捏造なら F。それが故障ではなく、仕組みが動いているということ。

-
01 · エンジン -

実在するか

-

レジストリ照合。届かなければ1回だけ再試行。それでもダメなら unresolved。推測のハルシネーションは付けない。

-
02 · 意味 -

実在論文を誠実に使っているか

-

Tier 1 だけ、抄録を1回余分に取る。主要アウトカム、対象集団、効果の向き。T3 や T4 は格上げしない。

-
03 · 敵対 -

KILL は仕様

-

レンズは5つ。KILL / MAJOR / MINOR / PASS。KILL または MAJOR は A では出せない。最大3パス。

-
04 · 修正 -

直したら、エンジンから入り直す

-

上限3回。その後は止まって残件を書く。T4 が残っているあいだは評点を上げない。

-

実例: ビタミンD — 主張台帳 → エンジン → 意味 → KILL。

-
60秒スタート -

入り方は3つ。まず CLI。

-

APIキー不要。MIT。書き方に合う経路を選ぶ。

-
01

CLI — インストール不要

# 単発・APIキー不要
-$ npx evidentia check your-article.md
-
02

エージェントスキル

SKILL.md が skills/medical-fact-check/SKILL.md にあるので、このコマンドで入ります。

# Claude Code、Cursor、Codex など、スキルを読むエージェント
-$ npx skills add kgraph57/evidentia
-
03

Claude プラグイン

$ /plugin marketplace add kgraph57/evidentia
-$ /plugin install evidentia@evidentia
-

エンジンをエージェントに載せるなら MCP: claude mcp add evidentia -- npx -y evidentia-mcp

-

Evidentia は執筆者・編集者・研究者のための公開前支援であり、臨床判断支援ではありません。診断・治療・医療専門家の判断を代替しません。

- - + + + + + Evidentia — 品質はどう担保されるか + + + + + + + + + + + + + + +
+
+ Evidentia + +
+
+
+
+
+

品質はどう担保されるか

+

Evidentia は、医学文章を公開する前の手順です。品質は宣伝用の採点表ではなく、ゲート付きのループで担保します。存在はレジストリ照合。使い方の誠実さはスキル。実在として出した捏造識別子は KILL です。

+

CLI + MCP エンジン · skills/medical-fact-check · MIT · 臨床判断支援ではない

+
+
+

flow

+
    +
  1. + +

    content

    +
  2. +
  3. + +
    +

    主張台帳 Claim ledger

    +
    +
    +
    確認
    +
    照合の前に、検証可能な主張と識別子をすべて抜き出す。見出しも対象。
    +
    +
    +
    停止
    +
    台帳ができるまで、エンジンは呼ばない。
    +
    +
    +
    +
  4. +
  5. + +
    +

    エンジン Engine

    +
    +
    +
    確認
    +
    存在。DOI / PMID / arXiv / NCT を CrossRef、PubMed、OpenAlex、arXiv、ClinicalTrials.gov に照合する。
    +
    +
    +
    失敗
    +
    1回だけ再試行。それでも落ちていれば unresolved(Hallucination と推測しない)。T4 は存在の事実であり、LLM が上書きしてはならない。ISBN・ガイドライン・タイトルのみは T2 であり、T4 にはしない。
    +
    +
    +
    +
  6. +
  7. + +
    +

    意味 Semantic

    +
    +
    +
    確認
    +
    誠実さ。T1 の引用ごとに抄録を1回取る。主要アウトカム、対象集団、効果の向き。
    +
    +
    +
    失敗
    +
    T3 / T4 は格上げしない。
    +
    +
    +
    +
  8. +
  9. + +
    +

    15項目 15-criteria

    +
    +
    +
    確認
    +
    文章の評価(治療の推奨ではない)。
    +
    +
    +
    停止
    +
    診断・治療・専門家の判断の代替ではない。
    +
    +
    +
    +
  10. +
  11. + +
    +

    敵対 Adversarial

    +
    +
    +
    確認
    +
    5つのレンズと10行のチェックリスト → KILL / MAJOR / MINOR / PASS.
    +
    +
    +
    失敗
    +
    KILL(実在として出した T4、または危害)は評点 ≤ D(捏造なら F)。MAJOR は A にできない。
    +
    +
    +

    loop 5 → 2 エンジン · 上限 3

    +
    +
  12. +
  13. + +
    +

    修正 Correction

    +
    +
    +
    確認
    +
    利用者が本文を直す。
    +
    +
    +
    停止
    +
    2 エンジンへ戻る。上限 3 回。その後は止まって、残件を書く。
    +
    +
    +
    +
  14. +
+
+ +
+

run

+
+
$ npx evidentia check examples/inputs/ai-generated-answer.md
+
+Evidentia: 4 citations — 1 verified, 1 mismatch, 2 hallucinated (75.0% fabrication rate)
+  [OK ] doi:10.1136/bmj.i6583       — Paper exists and the cited metadata matches the registry record.
+  [HAL] doi:10.1056/nejmoa2105512   — DOI does not resolve in CrossRef or OpenAlex, and no matching paper was found.
+  [HAL] pmid:18768876               — Identifier resolves to a different paper ("Trafficking of antigen-specific
+                                       CD8+ T lymphocytes…") than the one cited.
+  [MIS] doi:10.1002/14651858.cd012734 — Paper exists, but cited metadata disagrees with the record (year).
+
+

+ 収録済みの実行。ビタミンDと小児感染症。引用4件、実在は1件。Cochrane の DOI は T3 のまま(T4 に上げていない)。 + ケーススタディ: 主張台帳 → エンジン → 意味 → KILL。 +

+
+
+

install

+
+ +
npx evidentia check your-article.md
+npx skills add kgraph57/evidentia
+
+
+ +
+
+ + + + diff --git a/docs/site/css/style.css b/docs/site/css/style.css index 1a541a9..ef1646e 100644 --- a/docs/site/css/style.css +++ b/docs/site/css/style.css @@ -1,459 +1,362 @@ -/* Evidentia landing — self-contained, system fonts only */ +/* Protocol page. Lab SOP, not a landing. */ -* { box-sizing: border-box; } +*, *::before, *::after { box-sizing: border-box; } -html { scroll-behavior: smooth; } +html { scroll-behavior: auto; } body { margin: 0; - background: var(--paper); + background: var(--bg); color: var(--ink); font-family: var(--sans); - font-size: 17px; - line-height: 1.65; + font-size: 16px; + line-height: 1.55; -webkit-font-smoothing: antialiased; } -.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; } +:lang(ja) body { line-height: 1.7; } + +.wrap { + max-width: var(--flow); + margin: 0 auto; + padding: 0 24px; +} + +.measure { max-width: var(--measure); } -a { color: var(--navy); } +a { color: var(--ink); text-underline-offset: 3px; } +a:hover { text-decoration-thickness: 2px; } -code, pre { font-family: var(--mono); } +code, pre, kbd { font-family: var(--mono); } +code { font-size: 0.875em; } .skip-link { - position: absolute; left: -9999px; top: 0; - background: var(--ink); color: #fff; padding: 8px 16px; z-index: 100; + position: absolute; + left: -9999px; + top: 0; + background: var(--ink); + color: var(--bg); + padding: 8px 14px; + z-index: 100; } .skip-link:focus { left: 0; } -/* ---------- header ---------- */ - -.site-header { - position: sticky; top: 0; z-index: 50; - background: rgba(250, 248, 244, 0.92); - backdrop-filter: blur(6px); +/* masthead: not sticky, not frosted */ +.mast { border-bottom: 1px solid var(--line); + padding: 14px 0; } -.site-header-inner { - display: flex; align-items: center; gap: 20px; - padding-top: 12px; padding-bottom: 12px; + +.mast-inner { + display: flex; + align-items: baseline; + justify-content: space-between; + gap: 16px; } + .wordmark { - font-family: var(--serif); font-weight: 700; font-size: 18px; - color: var(--ink); text-decoration: none; white-space: nowrap; + font-family: var(--mono); + font-size: 13px; + color: var(--ink); + text-decoration: none; + letter-spacing: 0; } -.wordmark .tld { color: var(--navy); } -.site-nav { display: flex; gap: 18px; margin-left: auto; flex-wrap: wrap; } -.site-nav a { - color: var(--ink-soft); text-decoration: none; font-size: 14.5px; + +.wordmark:hover { text-decoration: underline; } + +.mast-nav { + display: flex; + gap: 16px; + font-size: 13px; } -.site-nav a:hover { color: var(--navy); } -/* ---------- buttons ---------- */ +.mast-nav a { + color: var(--mute); + text-decoration: none; +} -.btn { - display: inline-block; padding: 10px 20px; border-radius: 8px; - font-size: 15px; font-weight: 600; text-decoration: none; - border: 1.5px solid transparent; cursor: pointer; +.mast-nav a:hover, +.mast-nav a[aria-current="page"] { + color: var(--ink); + text-decoration: underline; } -.btn-primary { background: var(--navy); color: #fff; } -.btn-primary:hover { background: #0f1f52; } -.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; } -.btn-ghost:hover { background: var(--ink); color: var(--paper); } -.star-btn { white-space: nowrap; } -/* ---------- hero ---------- */ +.ident { + padding: 40px 0 8px; +} -#hero { padding: 64px 0 48px; } -.hero-grid { - display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: start; +.ident h1 { + font-family: var(--sans); + font-size: 1.75rem; + font-weight: 650; + line-height: 1.25; + letter-spacing: -0.015em; + margin: 0 0 14px; + font-style: normal; } -@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } } -.hero-kicker { - font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; - color: var(--navy); font-weight: 700; margin: 0 0 14px; +.ident p { + margin: 0 0 12px; + color: var(--ink); + max-width: var(--measure); } -h1 { - font-family: var(--serif); font-size: clamp(34px, 5vw, 52px); - line-height: 1.12; margin: 0 0 20px; letter-spacing: -0.01em; + +.ident p:last-child { margin-bottom: 0; } + +.ident .by { + color: var(--mute); + font-size: 14px; } -h1 em { font-style: normal; color: var(--navy); } -.lede { font-size: 18.5px; color: var(--ink-soft); margin: 0 0 26px; max-width: 34em; } -.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 0 0 18px; } -.hero-sub { font-size: 14px; color: var(--ink-faint); margin: 0; } -.hero-sub code { - background: var(--tint); padding: 2px 7px; border-radius: 5px; - color: var(--navy); font-size: 13px; + +.ident .by code { font-size: 12.5px; } + +.block { padding: 36px 0 8px; } + +.sec { + font-family: var(--mono); + font-size: 12px; + font-weight: 400; + color: var(--mute); + margin: 0 0 18px; + text-transform: none; + letter-spacing: 0; } -/* ---------- terminal / chat demo ---------- */ +/* vertical rail */ +.gates { + list-style: none; + margin: 0; + padding: 0 56px 0 0; + position: relative; +} -.term { - background: var(--term-bg); color: var(--term-ink); - border-radius: 12px; padding: 16px 16px 14px; - box-shadow: var(--shadow-card); +.gates::before { + content: ""; + position: absolute; + left: 15px; + top: 10px; + bottom: 36px; + width: 1px; + background: var(--line); } -.term-bar { - display: flex; gap: 6px; margin-bottom: 14px; align-items: center; + +.gates > li { + display: grid; + grid-template-columns: 32px 1fr; + gap: 16px; + position: relative; + padding: 0 0 28px; } -.term-dot { - width: 10px; height: 10px; border-radius: 50%; - background: rgba(255,255,255,0.18); + +.gates > li:last-child { padding-bottom: 0; } + +.n { + display: flex; + align-items: center; + justify-content: center; + width: 32px; + height: 32px; + border: 1px solid var(--ink); + background: var(--bg); + font-family: var(--mono); + font-size: 13px; + line-height: 1; + position: relative; + z-index: 1; } -.term-title { - margin-left: 8px; font-family: var(--mono); font-size: 12px; color: var(--term-dim); + +.n-src { + width: 8px; + height: 8px; + margin: 12px; + border: 1px solid var(--ink); + background: var(--bg); } -.chat { display: flex; flex-direction: column; gap: 12px; min-height: 280px; } -.chat-msg { opacity: 1; transform: none; transition: opacity 0.45s ease, transform 0.45s ease; } -.js .chat-msg { opacity: 0; transform: translateY(6px); } -.js .chat-msg.is-on { opacity: 1; transform: none; } -.chat-who { - display: block; font-family: var(--mono); font-size: 11px; - letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 5px; + +.src { + margin: 6px 0 4px; + font-family: var(--mono); + font-size: 13px; } -.chat-msg-user .chat-who { color: var(--term-amber); } -.chat-msg-agent .chat-who { color: var(--term-green); } -.chat-bubble { - background: rgba(255, 255, 255, 0.055); border-radius: 8px; - padding: 11px 14px; line-height: 1.55; white-space: pre-wrap; - font-size: 13.5px; + +.g h3 { + font-family: var(--sans); + font-size: 16px; + font-weight: 650; + margin: 5px 0 10px; + line-height: 1.3; } -.chat-msg-user .chat-bubble { border-left: 2px solid var(--term-amber); } -.chat-msg-agent .chat-bubble { border-left: 2px solid var(--term-green); } -.chat-bubble .g { color: var(--term-green); } -.chat-bubble .a { color: var(--term-amber); } -.chat-bubble .d { color: var(--term-dim); } -.chat-caret { - display: inline-block; width: 8px; height: 15px; vertical-align: -2px; - background: var(--term-amber); animation: blink 0.9s steps(1) infinite; -} -@keyframes blink { 50% { opacity: 0; } } -.chat-replay { - background: none; border: 1px solid rgba(255, 255, 255, 0.2); color: var(--term-dim); - font-family: var(--mono); font-size: 12px; border-radius: 6px; - padding: 5px 12px; cursor: pointer; margin-top: 4px; -} -.chat-replay:hover { color: var(--term-ink); border-color: var(--term-dim); } -.term-caption { text-align: center; font-size: 13px; color: var(--ink-faint); margin: 12px 0 0; } - -/* ---------- sections ---------- */ - -section { padding: 64px 0; } -section.band { - background: var(--paper-raised); - border-top: 1px solid var(--line); - border-bottom: 1px solid var(--line); + +.g h3 .aka { + font-family: var(--mono); + font-size: 12px; + font-weight: 400; + color: var(--mute); + margin-left: 8px; } -.kicker { - display: block; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; - color: var(--navy); font-weight: 700; margin-bottom: 10px; -} -h2 { - font-family: var(--serif); font-size: clamp(26px, 3.4vw, 36px); - line-height: 1.2; margin: 0 0 14px; -} -.section-lede { color: var(--ink-soft); max-width: 44em; margin: 0 0 34px; } - -/* ---------- sovereignty cards ---------- */ - -.sov-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 8px; } -@media (max-width: 720px) { .sov-grid { grid-template-columns: 1fr; } } -.sov-card { - background: var(--paper-raised); border: 1px solid var(--line); - border-top: 3px solid var(--gate); border-radius: var(--radius); padding: 22px 24px; - box-shadow: var(--shadow-card); -} -.sov-card h3 { margin: 0 0 8px; font-size: 19px; } -.sov-card p { margin: 0; color: var(--ink-soft); font-size: 15.5px; } - -/* ---------- pipeline ---------- */ - -.pipe { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; } -.pipe-step { - display: grid; grid-template-columns: 88px 1fr; gap: 16px; align-items: baseline; - background: var(--paper-raised); border: 1px solid var(--line); - border-radius: 8px; padding: 13px 18px; -} -.pipe-step.is-gate { border-left: 3px solid var(--gate); background: var(--gate-soft); } -.pipe-step.is-new { border-left: 3px solid var(--navy); } -.pipe-num { font-family: var(--mono); font-size: 13px; color: var(--ink-faint); white-space: nowrap; } -.pipe-label { font-weight: 600; font-size: 15.5px; } -.pipe-label small { display: block; font-weight: 400; color: var(--ink-soft); font-size: 13.5px; margin-top: 2px; } -.pipe-note { font-size: 14px; color: var(--ink-faint); margin-top: 18px; } -.pipe-note .kill { color: var(--risk); font-weight: 600; } - -/* ---------- humanizer before/after ---------- */ - -.hum-grid { display: grid; gap: 16px; margin-top: 8px; } -.hum-row { - display: grid; grid-template-columns: 1fr 1fr; gap: 0; - border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; - background: var(--paper-raised); -} -@media (max-width: 720px) { .hum-row { grid-template-columns: 1fr; } } -.hum-cell { padding: 16px 20px; font-size: 14.5px; line-height: 1.6; } -.hum-before { background: #fbf3f2; } -.hum-after { background: var(--tint); border-left: 1px solid var(--line); } -@media (max-width: 720px) { .hum-after { border-left: 0; border-top: 1px solid var(--line); } } -.hum-tag { - display: inline-block; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; - text-transform: uppercase; padding: 2px 8px; border-radius: 20px; margin-bottom: 8px; -} -.hum-before .hum-tag { background: #f3d9d6; color: var(--risk); } -.hum-after .hum-tag { background: #d9e4f7; color: var(--navy); } -.hum-cell del { color: var(--risk); text-decoration-color: rgba(185, 28, 28, 0.55); } -.hum-cell ins { color: var(--navy); text-decoration: none; font-weight: 600; } -.hum-pattern { display: block; font-size: 12.5px; color: var(--ink-faint); margin-top: 8px; } - -/* ---------- why starred ---------- */ - -.why-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; } -@media (max-width: 720px) { .why-grid { grid-template-columns: 1fr; } } -.why-card { - background: var(--paper-raised); border: 1px solid var(--line); - border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-card); -} -.why-card h3 { margin: 0 0 6px; font-size: 17px; } -.why-card p { margin: 0; font-size: 14.5px; color: var(--ink-soft); } -.why-card p code { - font-size: 13px; background: var(--tint); padding: 1px 6px; border-radius: 4px; -} - -/* ---------- install ---------- */ - -.install-shell { position: relative; margin: 0 0 22px; } -.install-term { - background: var(--term-bg); color: var(--term-ink); - border-radius: var(--radius); padding: 20px 22px; overflow-x: auto; - font-size: 14px; line-height: 1.8; margin: 0; -} -.install-term .c { color: var(--term-dim); } -.install-term .p { color: var(--term-green); user-select: none; } -.copy-btn { - position: absolute; top: 10px; right: 10px; - background: rgba(255, 255, 255, 0.1); color: var(--term-ink); - border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 6px; - font-family: var(--mono); font-size: 12px; padding: 5px 12px; cursor: pointer; -} -.copy-btn:hover { background: rgba(255, 255, 255, 0.18); } -.trigger-box { - border: 1px dashed var(--line); border-radius: var(--radius); - background: var(--paper-raised); padding: 18px 22px; -} -.trigger-box p { margin: 0 0 6px; font-size: 14px; color: var(--ink-faint); } -.trigger-box blockquote { - margin: 0; font-family: var(--serif); font-size: 17px; font-style: italic; -} - -/* ---------- case study ---------- */ - -.case-card { - background: var(--paper-raised); border: 1px solid var(--line); - border-left: 4px solid var(--navy); border-radius: var(--radius); - padding: 28px 30px; box-shadow: var(--shadow-card); -} -.case-card h3 { font-family: var(--serif); font-size: 22px; margin: 0 0 10px; } -.case-card p { color: var(--ink-soft); margin: 0 0 18px; max-width: 44em; } -.case-flow { - font-family: var(--mono); font-size: 13px; color: var(--ink-faint); - margin: 0 0 20px; word-break: break-word; -} -.case-flow b { color: var(--navy); font-weight: 600; } - -/* ---------- footer ---------- */ - -.site-footer { background: var(--term-bg); color: var(--term-ink); padding: 56px 0 40px; } -.ft-cta { font-family: var(--serif); font-size: clamp(20px, 2.6vw, 27px); line-height: 1.4; margin: 0 0 22px; max-width: 30em; } -.ft-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 0 0 34px; } -.ft-actions .btn-ghost { border-color: var(--term-dim); color: var(--term-ink); } -.ft-actions .btn-ghost:hover { background: var(--term-ink); color: var(--term-bg); } -.ft-divider { border: 0; border-top: 1px solid rgba(255, 255, 255, 0.12); margin: 0 0 22px; } -.ft-small { font-size: 13.5px; color: var(--term-dim); } -.ft-small p { margin: 0 0 8px; } -.ft-links { list-style: none; display: flex; gap: 18px; flex-wrap: wrap; padding: 0; margin: 14px 0 0; } -.ft-links a { color: var(--term-dim); } -.ft-links a:hover { color: var(--term-ink); } -@media (prefers-reduced-motion: reduce) { - html { scroll-behavior: auto; } - .chat-msg { transition: none; } - .chat-caret { animation: none; } +.rows { margin: 0; } + +.rows > div { + display: grid; + grid-template-columns: 3.6rem 1fr; + gap: 10px 12px; + margin: 0 0 8px; } +.rows > div:last-child { margin-bottom: 0; } -/* ---------- CLI report demo ---------- */ +.rows dt { + font-family: var(--mono); + font-size: 11px; + font-weight: 400; + color: var(--mute); + padding-top: 2px; +} -.cli { +.rows dd { margin: 0; - padding: 2px 2px 8px; - font-size: 12.5px; - line-height: 1.72; - overflow-x: auto; - white-space: pre-wrap; - word-break: break-word; - color: var(--term-ink); -} -.cli .p { color: var(--term-green); user-select: none; } -.cli .ok { color: var(--term-green); font-weight: 700; } -.cli .hal { color: var(--term-red); font-weight: 700; } -.cli .mis { color: var(--term-amber); font-weight: 700; } -.cli-line { display: block; } -.js .cli[data-cli] .cli-line { - opacity: 0; - transform: translateY(4px); - transition: opacity 0.35s ease, transform 0.35s ease; -} -.js .cli[data-cli] .cli-line.is-on { - opacity: 1; - transform: none; -} -.cli-replay { - background: none; border: 1px solid rgba(255, 255, 255, 0.2); color: var(--term-dim); - font-family: var(--mono); font-size: 12px; border-radius: 6px; - padding: 5px 12px; cursor: pointer; margin-top: 8px; -} -.cli-replay:hover { color: var(--term-ink); border-color: var(--term-dim); } - -/* ---------- why-now / Lancet ---------- */ - -.why-now { - background: var(--paper-raised); - border: 1px solid var(--line); - border-left: 4px solid var(--navy); - border-radius: var(--radius); - padding: 22px 26px; - box-shadow: var(--shadow-card); -} -.why-now p { margin: 0; color: var(--ink-soft); font-size: 15.5px; max-width: 52em; } -.why-now strong { color: var(--ink); } -.why-now .why-cite { - display: block; margin-top: 10px; font-size: 13px; color: var(--ink-faint); + font-size: 14.5px; + color: var(--ink); } -/* ---------- 4-tier ---------- */ +.kill { + color: var(--kill); + font-weight: 650; +} -.tier-grid { - display: grid; - grid-template-columns: 1fr 1fr; - gap: 16px; +/* right-hand loop 5 → 2 */ +.loop-a::after, +.loop-m::after, +.loop-z::after { + content: ""; + position: absolute; + right: -48px; + width: 40px; + box-sizing: border-box; + border-right: 1px solid var(--ink); + pointer-events: none; } -@media (max-width: 720px) { .tier-grid { grid-template-columns: 1fr; } } -.tier-card { - background: var(--paper-raised); - border: 1px solid var(--line); - border-radius: var(--radius); - padding: 20px 22px; - box-shadow: var(--shadow-card); -} -.tier-card h3 { margin: 0 0 8px; font-size: 17px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; } -.tier-card p { margin: 0; font-size: 14.5px; color: var(--ink-soft); } -.tier-mark { - font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; - padding: 2px 8px; border-radius: 20px; font-weight: 700; -} -.tier-ok { border-top: 3px solid var(--tier-ok); } -.tier-ok .tier-mark { background: #ecf8f4; color: var(--tier-ok); } -.tier-rev { border-top: 3px solid var(--tier-rev); } -.tier-rev .tier-mark { background: var(--tint); color: var(--navy); } -.tier-mis { border-top: 3px solid var(--tier-mis); } -.tier-mis .tier-mark { background: var(--gate-soft); color: var(--tier-mis); } -.tier-hal { border-top: 3px solid var(--tier-hal); } -.tier-hal .tier-mark { background: #fdf2f2; color: var(--tier-hal); } - -/* ---------- two layers ---------- */ - -.layer-grid { - display: grid; - grid-template-columns: 1fr 1fr; - gap: 22px; + +.loop-a::after { + top: 16px; + bottom: 0; + border-top: 1px solid var(--ink); } -@media (max-width: 720px) { .layer-grid { grid-template-columns: 1fr; } } -.layer-card { - background: var(--paper-raised); - border: 1px solid var(--line); - border-radius: var(--radius); - padding: 24px 26px; - box-shadow: var(--shadow-card); + +.loop-m::after { + top: 0; + bottom: 0; } -.layer-card h3 { margin: 0 0 8px; font-size: 18px; } -.layer-card p { margin: 0 0 12px; font-size: 15px; color: var(--ink-soft); } -.layer-card p:last-child { margin-bottom: 0; } -.layer-card code { - font-size: 13px; background: var(--tint); padding: 1px 6px; border-radius: 4px; + +.loop-z::after { + top: 0; + height: 16px; + border-bottom: 1px solid var(--ink); } -.layer-kicker { - display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; - text-transform: uppercase; color: var(--navy); font-weight: 700; margin-bottom: 8px; + +.reenter { + margin: 10px 0 0; + font-family: var(--mono); + font-size: 12px; + color: var(--ink); } -/* ---------- install paths ---------- */ +.reenter .arrow { color: var(--mute); } -.path-grid { display: grid; gap: 16px; margin: 0 0 22px; } -.path-card { - background: var(--paper-raised); - border: 1px solid var(--line); - border-radius: var(--radius); - padding: 18px 20px 8px; - box-shadow: var(--shadow-card); +@media (max-width: 720px) { + .gates { padding-right: 0; } + .loop-a::after, + .loop-m::after, + .loop-z::after { display: none; } } -.path-head { - display: flex; align-items: baseline; gap: 12px; margin: 0 0 10px; + +.cli-wrap { + border: 1px solid var(--line); + background: var(--bg); } -.path-num { - font-family: var(--mono); font-size: 12px; color: var(--navy); font-weight: 700; + +.cli { + margin: 0; + padding: 16px 18px; + font-size: 12.5px; + line-height: 1.65; + overflow-x: auto; + white-space: pre; + color: var(--ink); + background: var(--bg); } -.path-head h3 { margin: 0; font-size: 16px; } -.path-head p { margin: 0 0 0 auto; font-size: 13px; color: var(--ink-faint); } -.path-card .install-shell { margin-bottom: 12px; } -.path-note { font-size: 13.5px; color: var(--ink-soft); margin: 0 0 12px; } -.mcp-note { - font-size: 14px; color: var(--ink-soft); margin: 0 0 8px; + +.cli .ok { color: var(--ok); font-weight: 700; } +.cli .hal { color: var(--kill); font-weight: 700; } + +.case { + margin: 12px 0 0; + font-size: 14.5px; } -.mcp-note code { - font-size: 13px; background: var(--tint); padding: 1px 6px; border-radius: 4px; + +.install { + position: relative; + border: 1px solid var(--line); + background: var(--bg); } -/* ---------- not-CDS ---------- */ +.install pre { + margin: 0; + padding: 16px 72px 16px 18px; + font-size: 13.5px; + line-height: 1.8; + overflow-x: auto; + color: var(--ink); +} -.cds-note { - font-size: 14.5px; color: var(--ink-soft); - border: 1px dashed var(--line); border-radius: var(--radius); - padding: 14px 18px; margin: 8px 0 0; max-width: 48em; +.copy { + position: absolute; + top: 8px; + right: 8px; + font-family: var(--mono); + font-size: 12px; + color: var(--ink); + background: var(--bg); + border: 1px solid var(--line); + padding: 4px 10px; + cursor: pointer; } -@media (prefers-reduced-motion: reduce) { - .js .cli[data-cli] .cli-line { opacity: 1; transform: none; transition: none; } +.copy:hover { background: #f5f5f5; } +.copy:focus { outline: 1px solid var(--ink); outline-offset: 2px; } + +.note { + padding: 36px 0 8px; + color: var(--mute); + font-size: 13px; + max-width: var(--measure); } +.note p { margin: 0; } + +.foot { + border-top: 1px solid var(--line); + margin-top: 40px; + padding: 20px 0 40px; + font-size: 13px; + color: var(--mute); +} -/* ---------- verify loops ---------- */ +.foot p { margin: 0 0 6px; } -.loop-grid { - display: grid; - grid-template-columns: 1fr 1fr; - gap: 16px; +.foot-links { + display: flex; + flex-wrap: wrap; + gap: 14px; + margin: 12px 0 0; + padding: 0; + list-style: none; } -@media (max-width: 720px) { .loop-grid { grid-template-columns: 1fr; } } -.loop-card { - background: var(--paper-raised); - border: 1px solid var(--line); - border-top: 3px solid var(--navy); - border-radius: var(--radius); - padding: 20px 22px; - box-shadow: var(--shadow-card); -} -.loop-card h3 { margin: 0 0 8px; font-size: 17px; } -.loop-card p { margin: 0; font-size: 14.5px; color: var(--ink-soft); } -.loop-kicker { - display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; - text-transform: uppercase; color: var(--navy); font-weight: 700; margin-bottom: 8px; -} -.loop-card.loop-kill { border-top-color: var(--tier-hal); } -.loop-card.loop-kill .loop-kicker { color: var(--tier-hal); } -.verify-case { - margin: 22px 0 0; - font-size: 15px; - color: var(--ink-soft); - max-width: 48em; + +.foot-links a { color: var(--mute); } +.foot-links a:hover { color: var(--ink); } + +@media (prefers-reduced-motion: reduce) { + html { scroll-behavior: auto; } } diff --git a/docs/site/css/tokens.css b/docs/site/css/tokens.css index a6fed14..3a5e41c 100644 --- a/docs/site/css/tokens.css +++ b/docs/site/css/tokens.css @@ -1,43 +1,13 @@ +/* Evidentia protocol — ink on paper. No brand wash. */ :root { - --navy: #15296b; - --blue: #2563eb; - --ink: #1c2430; - --ink-soft: #4b5563; - --ink-faint: #8a93a1; - --grey-700: #374151; - --grey-500: #6b7280; - --grey-300: #d1d5db; - --fill: #f3f4f6; - --tint: #eff3fb; - --risk: #b91c1c; - --gate: #b45309; - --gate-soft: #fdf1e2; - --paper: #faf8f4; - --paper-raised: #ffffff; - --line: #e4e0d8; - --term-bg: #131a22; - --term-ink: #d7dee8; - --term-dim: #7d8899; - --term-green: #7fd1b9; - --term-amber: #e8b05c; - --term-red: #ef8a8a; - --tier-ok: #0f766e; - --tier-hal: #b91c1c; - --tier-mis: #b45309; - --tier-rev: #15296b; - --accent: var(--navy); - --accent-soft: var(--tint); - --radius: 10px; - - --serif: - Georgia, "Times New Roman", "Hiragino Mincho ProN", "Yu Mincho", serif; - --sans: - -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, - "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif; - --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace; - - --u: 8px; - --measure: 72rem; - --shadow-card: - 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(21, 41, 107, 0.08); + --bg: #ffffff; + --ink: #111111; + --mute: #666666; + --line: #e5e5e5; + --kill: #b00000; + --ok: #0b6e4f; + --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; + --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace; + --measure: 42.5rem; /* ~680px */ + --flow: 50rem; /* ~800px */ } diff --git a/docs/site/js/main.js b/docs/site/js/main.js index 6568e75..a361dfb 100644 --- a/docs/site/js/main.js +++ b/docs/site/js/main.js @@ -1,166 +1,45 @@ -/* Evidentia landing — copy buttons, optional chat player, CLI report demo. No dependencies. */ +/* Copy for the install block only. No typing. No replay. */ (function () { - "use strict"; - - document.documentElement.classList.add("js"); + function textOf(sel) { + var el = document.querySelector(sel); + if (!el) return ""; + return (el.innerText || el.textContent || "").replace(/\u00a0/g, " ").trim(); + } - var reduceMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches; + function fallback(text, done) { + var ta = document.createElement("textarea"); + ta.value = text; + ta.setAttribute("readonly", ""); + ta.style.position = "fixed"; + ta.style.left = "-9999px"; + document.body.appendChild(ta); + ta.select(); + try { + document.execCommand("copy"); + done(); + } catch (e) {} + document.body.removeChild(ta); + } document.querySelectorAll("[data-copy]").forEach(function (btn) { + var idle = btn.getAttribute("data-idle") || "Copy"; + var doneLabel = btn.getAttribute("data-done") || "Copied"; btn.addEventListener("click", function () { - var target = document.querySelector(btn.getAttribute("data-copy")); - if (!target) return; - var text = target.innerText.replace(/^\$ /gm, ""); - navigator.clipboard.writeText(text).then(function () { - var old = btn.textContent; - btn.textContent = btn.getAttribute("data-copied-label") || "Copied"; - setTimeout(function () { btn.textContent = old; }, 1400); - }); - }); - }); - - function playCli(cli) { - var lines = Array.prototype.slice.call(cli.querySelectorAll(".cli-line")); - if (!lines.length) return; - var replayBtn = cli.parentElement && cli.parentElement.querySelector(".cli-replay"); - var timers = []; - var started = false; - - function clearTimers() { - timers.forEach(function (t) { clearTimeout(t); }); - timers = []; - } - function later(fn, ms) { timers.push(setTimeout(fn, ms)); } - - function play() { - clearTimers(); - lines.forEach(function (el) { el.classList.remove("is-on"); }); - if (reduceMotion) { - lines.forEach(function (el) { el.classList.add("is-on"); }); - return; + var text = textOf(btn.getAttribute("data-copy")); + if (!text) return; + function ok() { + btn.textContent = doneLabel; + window.setTimeout(function () { + btn.textContent = idle; + }, 1600); } - var i = 0; - (function next() { - if (i >= lines.length) return; - lines[i].classList.add("is-on"); - i += 1; - later(next, i === 1 ? 420 : 160); - })(); - } - - if (replayBtn) replayBtn.addEventListener("click", play); - - if ("IntersectionObserver" in window) { - var io = new IntersectionObserver(function (entries) { - entries.forEach(function (e) { - if (e.isIntersecting && !started) { - started = true; - play(); - io.disconnect(); - } + if (navigator.clipboard && navigator.clipboard.writeText) { + navigator.clipboard.writeText(text).then(ok).catch(function () { + fallback(text, ok); }); - }, { threshold: 0.25 }); - io.observe(cli); - } else { - play(); - } - } - - document.querySelectorAll("[data-cli]").forEach(playCli); - - var chat = document.querySelector("[data-chat]"); - if (!chat) return; - - var msgs = Array.prototype.slice.call(chat.querySelectorAll(".chat-msg")); - var replayBtn = chat.parentElement.querySelector(".chat-replay"); - var timers = []; - var started = false; - - function clearTimers() { - timers.forEach(function (t) { clearTimeout(t); }); - timers = []; - } - - function later(fn, ms) { timers.push(setTimeout(fn, ms)); } - - function showAll() { - msgs.forEach(function (m) { - m.classList.add("is-on"); - var b = m.querySelector(".chat-bubble"); - if (b && b.__fullHTML) b.innerHTML = b.__fullHTML; - }); - } - - function typeInto(bubble, done) { - var full = bubble.__fullText; - bubble.textContent = ""; - var caret = document.createElement("span"); - caret.className = "chat-caret"; - bubble.appendChild(caret); - var i = 0; - (function tick() { - if (i <= full.length) { - if (bubble.firstChild && bubble.firstChild !== caret) { - bubble.removeChild(bubble.firstChild); - } - bubble.insertBefore(document.createTextNode(full.slice(0, i)), caret); - i += 1; - later(tick, 26 + Math.random() * 34); } else { - caret.remove(); - done(); - } - })(); - } - - function play() { - clearTimers(); - msgs.forEach(function (m) { - m.classList.remove("is-on"); - var b = m.querySelector(".chat-bubble"); - if (b) { - if (!b.__fullHTML) { - b.__fullHTML = b.innerHTML; - b.__fullText = b.textContent; - } - b.innerHTML = ""; + fallback(text, ok); } }); - if (reduceMotion) { showAll(); return; } - - var idx = 0; - (function next() { - if (idx >= msgs.length) return; - var m = msgs[idx]; - var bubble = m.querySelector(".chat-bubble"); - var isUser = m.classList.contains("chat-msg-user"); - idx += 1; - m.classList.add("is-on"); - if (isUser) { - typeInto(bubble, function () { later(next, 500); }); - } else { - later(function () { - bubble.innerHTML = bubble.__fullHTML; - later(next, 900 + Math.min(bubble.__fullText.length * 6, 2200)); - }, 550); - } - })(); - } - - if (replayBtn) replayBtn.addEventListener("click", play); - - if ("IntersectionObserver" in window) { - var io = new IntersectionObserver(function (entries) { - entries.forEach(function (e) { - if (e.isIntersecting && !started) { - started = true; - play(); - io.disconnect(); - } - }); - }, { threshold: 0.3 }); - io.observe(chat); - } else { - play(); - } + }); })();