davinci-paper/v3-pq/index.html
v3-pq/index.htmlRaw
1<!DOCTYPE html>
2<html lang="en" data-color-mode="light" data-light-theme="light" data-dark-theme="light">
3<head>
4 <meta charset="UTF-8">
5 <meta name="viewport" content="width=device-width, initial-scale=1.0">
6 <meta name="color-scheme" content="only light">
7 <title>DAVINCI v3-PQ — Post-Quantum Protocol Specification</title>
8 <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/github-markdown-css@5.8.1/github-markdown-light.min.css" integrity="sha384-y0W3M22ACdv+yTWx1gSgw8yRa++DRY7bp/LjeFT6Wz8Sawsr//4qb5BDQxsq+xJx" crossorigin="anonymous">
9 <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.css" integrity="sha384-nB0miv6/jRmo5UMMR1wu3Gz6NLsoTkbqJghGIsx//Rlm+ZU03BU6SQNC66uf4l5+" crossorigin="anonymous">
10 <style>
11 :root {
12 color-scheme: light;
13 --fgColor-default: #1f2328;
14 --fgColor-muted: #57606a;
15 --fgColor-accent: #0969da;
16 --bgColor-default: #ffffff;
17 --bgColor-muted: #f6f8fa;
18 --borderColor-default: #d0d7de;
19 }
20 body {
21 margin: 0;
22 background: linear-gradient(180deg, #eef2f7 0%, #f6f8fa 30%, #f6f8fa 100%);
23 color: #1f2328;
24 }
25 .topbar {
26 position: sticky;
27 top: 0;
28 z-index: 2;
29 display: flex;
30 gap: 12px;
31 align-items: center;
32 padding: 12px 16px;
33 border-bottom: 1px solid #d0d7de;
34 background: rgba(255, 255, 255, 0.95);
35 backdrop-filter: blur(4px);
36 }
37 .topbar a {
38 text-decoration: none;
39 border: 1px solid #d0d7de;
40 border-radius: 6px;
41 padding: 6px 10px;
42 color: #1f2328;
43 background: #f6f8fa;
44 font: 600 14px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
45 }
46 .markdown-body {
47 box-sizing: border-box;
48 min-width: 200px;
49 max-width: 980px;
50 margin: 14px auto 24px;
51 padding: 30px 28px 40px;
52 background: #fff;
53 border: 1px solid #d0d7de;
54 border-radius: 10px;
55 box-shadow: 0 10px 24px rgba(31, 35, 40, 0.07);
56 color: #1f2328 !important;
57 font-size: 17px;
58 line-height: 1.72;
59 }
60 .markdown-body p,
61 .markdown-body li,
62 .markdown-body blockquote,
63 .markdown-body td,
64 .markdown-body th {
65 color: #1f2328 !important;
66 }
67 .markdown-body h1,
68 .markdown-body h2,
69 .markdown-body h3 {
70 color: #0f172a !important;
71 letter-spacing: -0.01em;
72 }
73 .markdown-body a {
74 color: #0969da !important;
75 }
76 .markdown-body code {
77 color: #0550ae;
78 background: #f6f8fa;
79 }
80 .markdown-body pre {
81 background: #f6f8fa;
82 border: 1px solid #d0d7de;
83 border-radius: 8px;
84 }
85 .markdown-body img {
86 max-width: 100% !important;
87 height: auto !important;
88 display: block;
89 margin: 1.2rem auto;
90 border-radius: 6px;
91 cursor: zoom-in;
92 }
93 #lightbox {
94 position: fixed;
95 inset: 0;
96 z-index: 10;
97 display: none;
98 background: rgba(15, 23, 42, 0.92);
99 overflow: auto;
100 text-align: center;
101 cursor: zoom-out;
102 }
103 #lightbox.open { display: block; }
104 #lightbox img {
105 display: block;
106 margin: auto;
107 position: absolute;
108 inset: 0;
109 max-width: 94vw;
110 max-height: 94vh;
111 background: #fff;
112 border-radius: 8px;
113 padding: 14px;
114 box-sizing: border-box;
115 cursor: zoom-in;
116 }
117 #lightbox.zoomed { cursor: zoom-out; }
118 #lightbox.zoomed img {
119 position: static;
120 margin: 3vh auto;
121 max-width: none;
122 max-height: none;
123 width: 170vw;
124 cursor: zoom-out;
125 }
126 #lightbox .lb-hint {
127 position: fixed;
128 bottom: 14px;
129 left: 50%;
130 transform: translateX(-50%);
131 color: #e2e8f0;
132 font: 500 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
133 background: rgba(15, 23, 42, 0.75);
134 border-radius: 999px;
135 padding: 6px 14px;
136 pointer-events: none;
137 }
138 #status {
139 margin-left: auto;
140 font: 500 13px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
141 color: #57606a;
142 }
143 @media (max-width: 767px) {
144 .markdown-body {
145 margin: 0;
146 border-radius: 0;
147 border-left: none;
148 border-right: none;
149 padding: 22px 16px 30px;
150 font-size: 16px;
151 }
152 }
153 .markdown-body table th, .markdown-body table td { background: #ffffff !important; }
154 .markdown-body table tr:nth-child(2n) td { background: #f6f8fa !important; }
155 .markdown-body table th { background: #f6f8fa !important; }
156 </style>
157</head>
158<body>
159 <div class="topbar">
160 <a href="../">DAVINCI v2 spec</a>
161 <a href="spec.md" download>Download spec.md</a>
162 <a href="spec.md" target="_blank" rel="noopener noreferrer">Raw markdown</a>
163 <span id="status">Loading…</span>
164 </div>
165 <article id="content" class="markdown-body"></article>
166 <div id="lightbox" role="dialog" aria-modal="true" aria-label="Image viewer">
167 <img id="lightbox-img" src="" alt="">
168 <div class="lb-hint">click image to zoom · click outside or press Esc to close</div>
169 </div>
170 <script src="https://cdn.jsdelivr.net/npm/marked@15.0.12/lib/marked.umd.min.js" integrity="sha384-zCewoQXXb5Xf+2nvCjab0EbMl7FWVpJMsKyrc8M8DqxjFra4DY4XHwheVdHXa34k" crossorigin="anonymous"></script>
171 <script src="https://cdn.jsdelivr.net/npm/dompurify@3.1.7/dist/purify.min.js" integrity="sha384-XQqX/4yiUGu+oyr87jvWzRuqBUK/adrY0DunhL+tID9m/9dwSpV8h9Fk/Sg6ifVQ" crossorigin="anonymous"></script>
172 <script src="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.js" integrity="sha384-7zkQWkzuo3B5mTepMUcHkMB5jZaolc2xDwL6VFqjFALcbeS9Ggm/Yr2r3Dy4lfFg" crossorigin="anonymous"></script>
173 <script src="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/contrib/auto-render.min.js" integrity="sha384-43gviWU0YVjaDtb/GhzOouOXtZMP/7XUzwPTstBeZFe/+rCMvRwr4yROQP43s0Xk" crossorigin="anonymous"></script>
174 <script>
175 (async () => {
176 const status = document.getElementById('status');
177 const content = document.getElementById('content');
178 try {
179 const response = await fetch('spec.md', { cache: 'no-store' });
180 if (!response.ok) throw new Error('HTTP ' + response.status);
181 const md = await response.text();
182 marked.setOptions({ gfm: true, breaks: false });
183 const math = [];
184 const protectedMd = md.replace(/\$\$[\s\S]+?\$\$|\$[^\n$]+?\$/g, (m) => {
185 math.push(m);
186 return '@@MATH' + (math.length - 1) + '@@';
187 });
188 let html = DOMPurify.sanitize(marked.parse(protectedMd));
189 html = html.replace(/@@MATH(\d+)@@/g, (_, i) =>
190 math[+i].replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>'));
191 content.innerHTML = html;
192 if (window.renderMathInElement) {
193 window.renderMathInElement(content, {
194 throwOnError: false,
195 delimiters: [
196 { left: '$$', right: '$$', display: true },
197 { left: '$', right: '$', display: false }
198 ]
199 });
200 }
201 status.textContent = 'DAVINCI v3-PQ · draft';
202
203 const lightbox = document.getElementById('lightbox');
204 const lightboxImg = document.getElementById('lightbox-img');
205 const closeLightbox = () => {
206 lightbox.classList.remove('open', 'zoomed');
207 lightboxImg.src = '';
208 document.body.style.overflow = '';
209 };
210 content.addEventListener('click', (e) => {
211 const img = e.target.closest('img');
212 if (!img) return;
213 lightboxImg.src = img.src;
214 lightboxImg.alt = img.alt || '';
215 lightbox.classList.add('open');
216 document.body.style.overflow = 'hidden';
217 });
218 lightbox.addEventListener('click', (e) => {
219 if (e.target === lightboxImg) {
220 lightbox.classList.toggle('zoomed');
221 if (!lightbox.classList.contains('zoomed')) lightbox.scrollTo(0, 0);
222 } else {
223 closeLightbox();
224 }
225 });
226 document.addEventListener('keydown', (e) => {
227 if (e.key === 'Escape' && lightbox.classList.contains('open')) closeLightbox();
228 });
229 } catch (err) {
230 status.textContent = 'Failed to load spec';
231 content.innerHTML = '<p>Unable to render <code>spec.md</code>: ' + err.message + '</p>';
232 }
233 })();
234 </script>
235</body>
236</html>