plainscript-lang 1.0.3-beta → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/README.md +97 -120
  2. package/compiler/bundler.js +83 -12
  3. package/compiler/cli.js +62 -11
  4. package/compiler/dependency-detector.js +11 -0
  5. package/compiler/generator.js +280 -15
  6. package/compiler/lexer.js +2 -0
  7. package/compiler/parser.js +410 -28
  8. package/compiler/sourcemap.js +142 -0
  9. package/compiler/version.js +1 -1
  10. package/docs/CAPABILITY_GAP_AUDIT.md +17 -15
  11. package/docs/PLAINSCRIPT-SPEC.md +41 -39
  12. package/docs/index.html +60 -33
  13. package/docs/website/script.js +168 -19
  14. package/docs/website/style.css +187 -41
  15. package/examples/ai-providers.pln +1 -1
  16. package/examples/arrays.pln +1 -1
  17. package/examples/async-errors.pln +1 -1
  18. package/examples/auth-api.pln +1 -1
  19. package/examples/auth-sessions.pln +1 -1
  20. package/examples/basics.pln +1 -1
  21. package/examples/bots.pln +1 -1
  22. package/examples/cache-and-jobs.pln +1 -1
  23. package/examples/cache-schedule.pln +1 -1
  24. package/examples/collections.pln +1 -1
  25. package/examples/concurrency.pln +1 -1
  26. package/examples/conditions.pln +1 -1
  27. package/examples/database.pln +1 -1
  28. package/examples/day2.pln +1 -1
  29. package/examples/day3.pln +1 -1
  30. package/examples/deployment.pln +1 -1
  31. package/examples/email-send.pln +1 -1
  32. package/examples/error-handling.pln +1 -1
  33. package/examples/expressions.pln +1 -1
  34. package/examples/file-uploads.pln +1 -1
  35. package/examples/files-and-config.pln +1 -1
  36. package/examples/files.pln +1 -1
  37. package/examples/football-backend/app.pln +1 -1
  38. package/examples/functions.pln +1 -1
  39. package/examples/hello.pln +1 -1
  40. package/examples/http-client.pln +1 -1
  41. package/examples/http.pln +1 -1
  42. package/examples/id-verification/app.pln +1 -1
  43. package/examples/json.pln +1 -1
  44. package/examples/loops.pln +1 -1
  45. package/examples/modules/app.pln +1 -1
  46. package/examples/modules/main.pln +1 -1
  47. package/examples/modules/math.pln +1 -1
  48. package/examples/mongo.pln +33 -0
  49. package/examples/objects.pln +1 -1
  50. package/examples/ocr.pln +1 -1
  51. package/examples/packages.pln +1 -1
  52. package/examples/record-kinds.pln +1 -1
  53. package/examples/records.pln +1 -1
  54. package/examples/rest-api-fetch.pln +1 -1
  55. package/examples/rest-api.pln +1 -1
  56. package/examples/scheduled-tasks.pln +1 -1
  57. package/examples/search-and-filter.pln +1 -1
  58. package/examples/server.pln +1 -1
  59. package/examples/sessions-and-cookies.pln +1 -1
  60. package/examples/sqlite.pln +1 -1
  61. package/examples/start.pln +1 -1
  62. package/examples/stdlib.pln +1 -1
  63. package/examples/string-verbs.pln +16 -0
  64. package/examples/telegram-ai-bot.pln +1 -1
  65. package/examples/telegram-bot.pln +1 -1
  66. package/examples/testing.pln +1 -1
  67. package/examples/web-api.pln +1 -1
  68. package/examples/web-app.pln +1 -1
  69. package/examples/websocket-server.pln +1 -1
  70. package/examples/websocket.pln +1 -1
  71. package/examples/whatsapp-bot/pairing.pln +1 -1
  72. package/examples/whatsapp-bot/qr.pln +1 -1
  73. package/package.json +3 -2
@@ -1,26 +1,175 @@
1
1
  (() => {
2
2
  "use strict";
3
3
 
4
+ const prefersReduced = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
5
+
6
+ // ── three.js animated background ──────────────────────────────────────
7
+ function mountBackground() {
8
+ const canvas = document.getElementById("bg-canvas");
9
+ if (!canvas || !window.WebGLRenderingContext) return;
10
+
11
+ const renderer = new THREE.WebGLRenderer({ canvas, alpha: true, antialias: true });
12
+ renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
13
+
14
+ const scene = new THREE.Scene();
15
+ const camera = new THREE.PerspectiveCamera(70, 1, 0.1, 100);
16
+ camera.position.z = 16;
17
+
18
+ const group = new THREE.Group();
19
+ scene.add(group);
20
+
21
+ // Distant particle field
22
+ const starCount = prefersReduced ? 0 : 800;
23
+ const positions = new Float32Array(starCount * 3);
24
+ for (let i = 0; i < starCount; i++) {
25
+ positions[i * 3] = (Math.random() - 0.5) * 34;
26
+ positions[i * 3 + 1] = (Math.random() - 0.5) * 22;
27
+ positions[i * 3 + 2] = (Math.random() - 0.5) * 30;
28
+ }
29
+ const starGeo = new THREE.BufferGeometry();
30
+ starGeo.setAttribute("position", new THREE.BufferAttribute(positions, 3));
31
+ const starMat = new THREE.PointsMaterial({
32
+ color: 0x46e6b4,
33
+ size: 0.09,
34
+ transparent: true,
35
+ opacity: 0.55,
36
+ sizeAttenuation: true,
37
+ depthWrite: false,
38
+ });
39
+ const stars = new THREE.Points(starGeo, starMat);
40
+ group.add(stars);
41
+
42
+ // Two soft wireframe rings for structure
43
+ const ringMat = new THREE.MeshBasicMaterial({
44
+ color: 0x46e6b4,
45
+ wireframe: true,
46
+ transparent: true,
47
+ opacity: 0.12,
48
+ });
49
+ for (const [radius, tilt, speed] of [[9.5, 0.4, 0.22], [6.5, -0.25, -0.16]]) {
50
+ const ring = new THREE.Mesh(new THREE.TorusGeometry(radius, 0.05, 8, 96), ringMat);
51
+ ring.rotation.x = tilt;
52
+ ring.rotation.y = 0.6;
53
+ group.add(ring);
54
+ ring.userData.speed = speed;
55
+ }
56
+
57
+ let mouseX = 0;
58
+ let mouseY = 0;
59
+ window.addEventListener("pointermove", (event) => {
60
+ mouseX = (event.clientX / window.innerWidth) * 2 - 1;
61
+ mouseY = (event.clientY / window.innerHeight) * 2 - 1;
62
+ }, { passive: true });
63
+
64
+ function resize() {
65
+ const width = window.innerWidth;
66
+ const height = window.innerHeight;
67
+ renderer.setSize(width, height);
68
+ camera.aspect = width / height;
69
+ camera.updateProjectionMatrix();
70
+ }
71
+ resize();
72
+ window.addEventListener("resize", resize);
73
+
74
+ const clock = new THREE.Clock();
75
+ function tick() {
76
+ const elapsed = clock.getElapsedTime();
77
+ group.rotation.y = elapsed * 0.06;
78
+ group.children.forEach((child) => {
79
+ if (child.userData.speed) {
80
+ child.rotation.z += child.userData.speed * 0.004;
81
+ }
82
+ });
83
+ // Parallax toward the cursor
84
+ const targetY = elapsed * 0.06 + mouseX * 0.15;
85
+ group.rotation.x += (mouseY * 0.12 - group.rotation.x) * 0.04;
86
+ group.rotation.y += (targetY - group.rotation.y) * 0.04;
87
+ camera.position.x += (mouseX * 1.1 - camera.position.x) * 0.03;
88
+ camera.position.y += (mouseY * 0.7 - camera.position.y) * 0.03;
89
+ camera.lookAt(scene.position);
90
+ renderer.render(scene, camera);
91
+ requestAnimationFrame(tick);
92
+ }
93
+ if (!prefersReduced) tick();
94
+ }
95
+ mountBackground();
96
+
97
+ // ── GSAP entrance + scroll reveals ────────────────────────────────────
98
+ const gsapOk = window.gsap && !prefersReduced;
99
+
100
+ if (gsapOk) {
101
+ gsap.registerPlugin(window.ScrollTrigger);
102
+
103
+ // Hero entrance
104
+ gsap.from(".hero-badge", { opacity: 0, y: 18, duration: 0.7, ease: "power2.out" });
105
+ gsap.from(".hero-title", {
106
+ opacity: 0, y: 30, duration: 0.9, ease: "power3.out", delay: 0.1,
107
+ });
108
+ gsap.from(".hero-lead", { opacity: 0, y: 22, duration: 0.8, ease: "power2.out", delay: 0.22 });
109
+ gsap.from(".hero-actions .button", {
110
+ opacity: 0, y: 18, duration: 0.6, ease: "power2.out", delay: 0.32, stagger: 0.08,
111
+ });
112
+ gsap.from(".hero .code-window", { opacity: 0, y: 26, duration: 0.8, ease: "power2.out", delay: 0.44 });
113
+
114
+ // Scroll reveals for cards and blocks
115
+ gsap.utils.toArray("[data-reveal]").forEach((el) => {
116
+ gsap.from(el, {
117
+ opacity: 0,
118
+ y: 28,
119
+ duration: 0.7,
120
+ ease: "power2.out",
121
+ scrollTrigger: { trigger: el, start: "top 88%", once: true },
122
+ });
123
+ });
124
+
125
+ // Stagger card grids
126
+ gsap.utils.toArray(".three-column, .feature-grid").forEach((grid) => {
127
+ gsap.from(grid.children, {
128
+ opacity: 0,
129
+ y: 30,
130
+ duration: 0.6,
131
+ ease: "power2.out",
132
+ stagger: 0.08,
133
+ scrollTrigger: { trigger: grid, start: "top 86%", once: true },
134
+ });
135
+ });
136
+ } else {
137
+ // No-JS / reduced-motion fallback: keep everything visible
138
+ document.querySelectorAll("[data-reveal]").forEach((el) => el.style.opacity = 1);
139
+ document.querySelectorAll(".hero-badge, .hero-title, .hero-lead, .hero .code-window").forEach((el) => {
140
+ el.style.opacity = 1;
141
+ });
142
+ }
143
+
144
+ // Nav blur once scrolled
145
+ const nav = document.getElementById("site-nav");
146
+ const onScroll = () => nav && nav.classList.toggle("is-scrolled", window.scrollY > 10);
147
+ window.addEventListener("scroll", onScroll, { passive: true });
148
+ onScroll();
149
+
150
+ // ── Feature library (search + filter) ─────────────────────────────────
4
151
  const examples = [
5
- { category: "core", name: "Variables", description: "Declare and update values.", source: 'remember name as "Ada"\nremember count as 3\ncount becomes count + 1\nshow `Hello, ${name}!`' },
6
- { category: "core", name: "Conditions", description: "Use readable comparisons.", source: 'if score is at least 80 and name contains "A"\n show "accepted"\notherwise\n show "review"\ndone' },
7
- { category: "core", name: "Loops", description: "Iterate collections and ranges.", source: 'for each item in list with "one", "two"\n show item\ndone\n\nfor index i from 0 to 2\n show i\ndone' },
8
- { category: "core", name: "Functions", description: "Define functions with return values.", source: 'make add(a, b)\n give a + b\ndone\n\nshow add(2, 3)' },
9
- { category: "data", name: "Records", description: "Define record kinds and values.", source: 'define a kind called "Player" with\n name is ""\n goals is 0\ndone\nremember player as create a Player with name "Ada" and goals 4' },
10
- { category: "data", name: "JSON", description: "Encode and decode structured data.", source: 'remember payload as {ok: true, count: 2}\nremember encoded as jsonEncode(payload)\nshow encoded' },
11
- { category: "data", name: "SQLite", description: "Run parameterized SQL blocks.", source: 'database "app.db" using "wasm"\nexecute\n CREATE TABLE items (name TEXT)\ndone\nremember items as query\n SELECT name FROM items\ndone' },
12
- { category: "web", name: "Web routes", description: "Create an HTTP app and JSON route.", source: 'web app\nroute get "/health"\n reply json\n ok is true\n done\ndone\nstart 3000' },
13
- { category: "web", name: "HTTP client", description: "Call an HTTP endpoint.", source: 'remember response as get "https://example.com/data" timeout 5000\nshow response.status' },
14
- { category: "web", name: "Auth and sessions", description: "Protect routes and persist sessions.", source: 'web app\nenable sessions "session-secret"\nrequire api key from env("API_KEY")\nroute get "/me"\n reply json\n user is user of session of request\n done\ndone' },
15
- { category: "runtime", name: "Async errors", description: "Await work and recover errors.", source: 'try\n remember result as get "https://example.com" timeout 5000\nrecover as error\n show message of error\nfinally\n show "finished"' },
16
- { category: "runtime", name: "Concurrency", description: "Run promise groups with a timeout.", source: 'remember results as allOf(list with firstJob(), secondJob())\nremember quick as withTimeout(firstJob(), 1000)\nshow results' },
17
- { category: "runtime", name: "WebSockets", description: "Handle socket connections and messages.", source: 'websocket server on 8080\n when socket connects\n send socket "connected"\n done\n when socket sends message\n broadcast message\n done\ndone' },
18
- { category: "runtime", name: "Cache", description: "Store values with a TTL.", source: 'cache env("REDIS_URL")\ncacheSet("status", "ready", 60)\nremember status as cacheGet("status")' },
19
- { category: "integrations", name: "Telegram", description: "Respond to bot messages.", source: 'bot env("TELEGRAM_BOT_TOKEN")\nwhen someone sends "/start"\n reply "Welcome"\ndone\nstart telegram bot' },
20
- { category: "integrations", name: "Groq AI", description: "Use provider-backed replies anywhere.", source: 'remember answer as chatWith("groq", "llama-3.3-70b-versatile", "Hello")\nshow answer' },
21
- { category: "integrations", name: "OCR uploads", description: "Read text from an uploaded image.", source: 'web app\naccept uploads limit "5 MB" allow list with "image/png" folder "uploads"\nroute post "/scan"\n remember file as upload("document")\n ocr path of file as text\n reply text\ndone' },
22
- { category: "tooling", name: "Native tests", description: "Check behavior in PlainScript.", source: 'test "addition works"\n check add(2, 3) equals 5\ndone' },
23
- { category: "tooling", name: "Modules", description: "Import a named export.", source: 'import { circleArea } from "./math.pln"\nshow circleArea(2)' }
152
+ { category: "core", name: "Variables", description: "Store and update values.", source: 'remember name as "Ada"\nremember count as 3\ncount becomes count + 1\nshow `Hello, ${name}!`' },
153
+ { category: "core", name: "Conditions", description: "Compare values in plain words.", source: 'if score is at least 80 and name contains "A"\n show "accepted"\notherwise\n show "review"\ndone' },
154
+ { category: "core", name: "Loops", description: "Go through lists and ranges.", source: 'for each item in list with "one", "two"\n show item\ndone\n\nfor index i from 0 to 2\n show i\ndone' },
155
+ { category: "core", name: "Functions", description: "Create reusable functions.", source: 'make add(a, b)\n give a + b\ndone\n\nshow add(2, 3)' },
156
+ { category: "core", name: "Modules", description: "Share code across files.", source: 'bring circleArea from "./math.pln"\nbring button from "@/components/button.pln"\nexport circleArea and squareArea' },
157
+ { category: "data", name: "Records", description: "Define the shape of your data.", source: 'define a kind called "Player" with\n name is ""\n goals is 0\ndone\nremember player as create a Player with name "Ada" and goals 4' },
158
+ { category: "data", name: "JSON", description: "Work with JSON data.", source: 'remember payload as {ok: true, count: 2}\nremember encoded as jsonEncode(payload)\nshow encoded' },
159
+ { category: "data", name: "Compound Types", description: "Use dictionaries, sets, and tuples.", source: 'remember userMap as dictionary with "name" is "Ada" and "role" is "admin" done\nremember tags as set with "admin", "editor" done\nremember point as tuple with 10, 20, 30 done' },
160
+ { category: "data", name: "SQLite", description: "Run safe SQL queries.", source: 'database "app.db" using "wasm"\nexecute\n CREATE TABLE items (name TEXT)\ndone\nremember items as query\n SELECT name FROM items\ndone' },
161
+ { category: "web", name: "Web routes", description: "Build an HTTP app with JSON routes.", source: 'web app\nroute get "/health"\n reply json\n ok is true\n done\ndone\nstart 3000' },
162
+ { category: "web", name: "HTTP client", description: "Fetch data from a URL.", source: 'remember response as get "https://example.com/data" timeout 5000\nshow response.status' },
163
+ { category: "web", name: "Auth and sessions", description: "Protect routes and track visitors.", source: 'web app\nenable sessions "session-secret"\nrequire api key from env("API_KEY")\nroute get "/me"\n reply json\n user is user of session of request\n done\ndone' },
164
+ { category: "runtime", name: "Async errors", description: "Handle errors gracefully.", source: 'try\n remember result as get "https://example.com" timeout 5000\nrecover as error\n show message of error\nfinally\n show "finished"' },
165
+ { category: "runtime", name: "Concurrency", description: "Run several tasks at once.", source: 'remember results as allOf(list with firstJob(), secondJob())\nremember quick as withTimeout(firstJob(), 1000)\nshow results' },
166
+ { category: "runtime", name: "WebSockets", description: "Chat and push updates live.", source: 'websocket server on 8080\n when socket connects\n send socket "connected"\n done\n when socket sends message\n broadcast message\n done\ndone' },
167
+ { category: "runtime", name: "Cache", description: "Keep values ready with a TTL.", source: 'cache env("REDIS_URL")\ncacheSet("status", "ready", 60)\nremember status as cacheGet("status")' },
168
+ { category: "integrations", name: "Telegram", description: "Build a Telegram bot.", source: 'bot env("TELEGRAM_BOT_TOKEN")\nwhen someone sends "/start"\n reply "Welcome"\ndone\nstart telegram bot' },
169
+ { category: "integrations", name: "Groq AI", description: "Get AI replies in your code.", source: 'remember answer as chatWith("groq", "llama-3.3-70b-versatile", "Hello")\nshow answer' },
170
+ { category: "integrations", name: "OCR uploads", description: "Read text from uploaded images.", source: 'web app\naccept uploads limit "5 MB" allow list with "image/png" folder "uploads"\nroute post "/scan"\n remember file as upload("document")\n ocr path of file as text\n reply text\ndone' },
171
+ { category: "tooling", name: "Native tests", description: "Check that your code works.", source: 'test "addition works"\n check add(2, 3) equals 5\ndone' },
172
+ { category: "tooling", name: "Source Maps", description: "Debug right in your .pln files.", source: 'plainscript build src/main.pln --sourcemap\n\n// or in code:\n// plainscript run src/main.pln --sourcemap' }
24
173
  ];
25
174
 
26
175
  const grid = document.getElementById("lib-grid");
@@ -1,70 +1,216 @@
1
1
  :root {
2
- --ink: #132238;
3
- --muted: #5f7084;
4
- --paper: #f7fafc;
5
- --panel: #ffffff;
6
- --line: #dce5ec;
7
- --accent: #1c8c77;
8
- --accent-dark: #11624f;
9
- --navy: #142c4a;
2
+ --bg: #070c16;
3
+ --bg-elev: #0b1220;
4
+ --panel: rgba(18, 26, 42, .78);
5
+ --panel-solid: #101828;
6
+ --line: rgba(120, 160, 230, .16);
7
+ --line-strong: rgba(120, 160, 230, .3);
8
+ --text: #e6edf7;
9
+ --muted: #8fa0b8;
10
+ --accent: #46e6b4;
11
+ --accent-glow: rgba(70, 230, 180, .35);
12
+ --accent-dim: #1f3d3a;
13
+ --haze: rgba(70, 230, 180, .07);
10
14
  --radius: 14px;
11
- --shadow: 0 18px 45px rgba(20, 44, 74, .1);
12
15
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
13
- color: var(--ink);
14
- background: var(--paper);
16
+ color: var(--text);
17
+ background: var(--bg);
15
18
  }
16
19
 
17
20
  * { box-sizing: border-box; }
18
21
  html { scroll-behavior: smooth; }
19
- body { margin: 0; line-height: 1.6; }
20
- a { color: var(--accent-dark); }
21
- code, pre { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
22
- code { font-size: .92em; }
22
+ body { margin: 0; line-height: 1.6; overflow-x: hidden; }
23
+ a { color: var(--accent); }
24
+ a:hover { color: #9ff2da; }
25
+ code, pre { font-family: "SFMono-Regular", Consolas, "Liberation Mono", ui-monospace, monospace; }
26
+ code { font-size: .92em; color: #bfe9ff; }
27
+
23
28
  .container { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
24
- .site-nav { position: sticky; top: 0; z-index: 5; background: rgba(247, 250, 252, .94); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
29
+
30
+ /* Full-bleed animated background */
31
+ .bg-scrim, #bg-canvas {
32
+ position: fixed;
33
+ inset: 0;
34
+ width: 100%;
35
+ height: 100%;
36
+ }
37
+ .bg-scrim {
38
+ z-index: -2;
39
+ background:
40
+ radial-gradient(1100px 640px at 78% -10%, rgba(70, 230, 180, .14), transparent 62%),
41
+ radial-gradient(900px 560px at 6% 28%, rgba(60, 110, 240, .12), transparent 60%),
42
+ linear-gradient(180deg, #070c16 0%, #0a1120 55%, #070c16 100%);
43
+ }
44
+ #bg-canvas { z-index: -1; opacity: .85; }
45
+
46
+ /* Nav */
47
+ .site-nav {
48
+ position: sticky;
49
+ top: 0;
50
+ z-index: 6;
51
+ border-bottom: 1px solid transparent;
52
+ background: rgba(7, 12, 22, .55);
53
+ backdrop-filter: blur(14px);
54
+ transition: background .3s ease, border-color .3s ease;
55
+ }
56
+ .site-nav.is-scrolled { background: rgba(7, 12, 22, .85); border-color: var(--line); }
25
57
  .nav-inner, .nav-logo, .nav-links, .hero-actions, .footer-bottom, .library-toolbar { display: flex; align-items: center; }
26
58
  .nav-inner { min-height: 72px; justify-content: space-between; gap: 24px; }
27
- .nav-logo { gap: 10px; color: var(--navy); font-weight: 800; text-decoration: none; }
28
- .nav-logo-image { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; }
29
- .logo-ver { padding: 3px 8px; border-radius: 99px; color: var(--accent-dark); background: #dff3ec; font-size: .72rem; }
30
- .nav-links { gap: 20px; }
31
- .nav-links a { color: var(--muted); font-size: .9rem; text-decoration: none; }
32
- .nav-links a:hover { color: var(--accent-dark); }
33
- .hero { padding: 96px 0 84px; background: linear-gradient(145deg, #eaf8f3, #f7fafc 60%); }
34
- .hero-content { max-width: 840px; }
35
- .hero-badge, .section-tag { color: var(--accent-dark); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: .76rem; }
36
- .hero-title { max-width: 780px; margin: 14px 0 16px; color: var(--navy); font-size: clamp(2.7rem, 7vw, 5.6rem); line-height: .98; letter-spacing: -.055em; }
59
+ .nav-logo { gap: 10px; color: var(--text); font-weight: 800; text-decoration: none; letter-spacing: -.01em; }
60
+ .nav-logo-mark {
61
+ display: inline-grid;
62
+ place-items: center;
63
+ width: 30px;
64
+ height: 30px;
65
+ border-radius: 8px;
66
+ color: #04140f;
67
+ background: var(--accent);
68
+ font-size: .82rem;
69
+ font-weight: 900;
70
+ box-shadow: 0 0 18px var(--accent-glow);
71
+ }
72
+ .logo-ver { padding: 3px 8px; border-radius: 99px; color: var(--accent); border: 1px solid var(--line-strong); background: var(--accent-dim); font-size: .72rem; font-weight: 600; }
73
+ .nav-links { gap: 22px; }
74
+ .nav-links a { color: var(--muted); font-size: .9rem; text-decoration: none; transition: color .2s; }
75
+ .nav-links a:hover { color: var(--accent); }
76
+
77
+ /* Hero */
78
+ .hero { position: relative; padding: 108px 0 92px; }
79
+ .hero-content { max-width: 840px; position: relative; z-index: 1; }
80
+ .hero-badge, .section-tag { color: var(--accent); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: .76rem; }
81
+ .hero-title {
82
+ max-width: 780px;
83
+ margin: 14px 0 16px;
84
+ color: var(--text);
85
+ font-size: clamp(2.7rem, 7vw, 5.6rem);
86
+ line-height: .98;
87
+ letter-spacing: -.055em;
88
+ text-wrap: balance;
89
+ }
90
+ .hero-title > span { display: inline-block; }
37
91
  .hero-lead { max-width: 660px; color: var(--muted); font-size: 1.2rem; }
38
92
  .hero-actions { gap: 12px; margin: 30px 0; flex-wrap: wrap; }
39
- .button { display: inline-block; padding: 11px 18px; border-radius: 9px; font-weight: 750; text-decoration: none; }
40
- .button-primary { color: #fff; background: var(--accent-dark); }
41
- .button-secondary { color: var(--navy); background: #fff; border: 1px solid var(--line); }
42
- .code-window { overflow: auto; margin: 28px 0 0; padding: 24px; border: 1px solid #23415f; border-radius: var(--radius); color: #e8f5ef; background: #10263f; box-shadow: var(--shadow); }
93
+ .button { display: inline-block; padding: 11px 18px; border-radius: 9px; font-weight: 750; text-decoration: none; transition: transform .2s ease, box-shadow .2s ease, background .2s ease; }
94
+ .button-primary { color: #04140f; background: var(--accent); box-shadow: 0 8px 26px var(--accent-glow); }
95
+ .button-primary:hover { color: #04140f; background: #7bf0cd; transform: translateY(-2px); box-shadow: 0 12px 32px var(--accent-glow); }
96
+ .button-secondary { color: var(--text); background: var(--panel); border: 1px solid var(--line-strong); backdrop-filter: blur(8px); }
97
+ .button-secondary:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
98
+
99
+ /* Code windows */
100
+ .code-window {
101
+ position: relative;
102
+ overflow: auto;
103
+ margin: 28px 0 0;
104
+ padding: 26px 24px 24px;
105
+ border: 1px solid var(--line-strong);
106
+ border-radius: var(--radius);
107
+ color: #d7f6ea;
108
+ background: linear-gradient(180deg, #0c1524, #0a101d);
109
+ box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
110
+ }
111
+ .code-window::before {
112
+ content: "";
113
+ display: block;
114
+ width: 46px;
115
+ height: 10px;
116
+ margin: -8px 0 18px;
117
+ border-radius: 99px;
118
+ background: var(--line-strong);
119
+ }
120
+ .code-window code { color: inherit; }
121
+
43
122
  .section { padding: 84px 0; }
44
- .section--alt { background: #eef5f6; }
45
- .section-title { max-width: 720px; margin: 8px 0 34px; color: var(--navy); font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.05; letter-spacing: -.035em; }
123
+ .section--alt { background: linear-gradient(180deg, var(--haze), transparent 42%), rgba(12, 19, 33, .55); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
124
+ .section-title { max-width: 720px; margin: 8px 0 34px; color: var(--text); font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.05; letter-spacing: -.035em; text-wrap: balance; }
46
125
  .section-lead { color: var(--muted); }
47
126
  .three-column, .feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
48
- .info-card, .feature-card, .library-card { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
49
- .info-card h3, .feature-card h3, .library-card h3 { margin: 8px 0 6px; color: var(--navy); }
127
+
128
+ /* Cards */
129
+ .info-card, .feature-card, .library-card {
130
+ padding: 24px;
131
+ border: 1px solid var(--line);
132
+ border-radius: var(--radius);
133
+ background: var(--panel);
134
+ backdrop-filter: blur(10px);
135
+ transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
136
+ }
137
+ .info-card:hover, .feature-card:hover, .library-card:hover {
138
+ transform: translateY(-4px);
139
+ border-color: var(--line-strong);
140
+ box-shadow: 0 18px 44px rgba(0, 0, 0, .45);
141
+ }
142
+ .info-card h3, .feature-card h3, .library-card h3 { margin: 8px 0 6px; color: var(--text); }
50
143
  .info-card p, .feature-card p, .library-card p { margin: 0; color: var(--muted); }
51
- .card-number { color: var(--accent); font-size: .8rem; font-weight: 850; letter-spacing: .08em; }
144
+ .card-number { color: var(--accent); font-size: .8rem; font-weight: 850; letter-spacing: .08em; text-shadow: 0 0 14px var(--accent-glow); }
145
+
52
146
  .capability-list { display: flex; gap: 10px; flex-wrap: wrap; }
53
- .capability-list span, .library-category { padding: 8px 12px; border-radius: 99px; color: var(--accent-dark); background: #dff3ec; font-size: .84rem; font-weight: 700; }
147
+ .capability-list span, .library-category {
148
+ padding: 8px 12px;
149
+ border-radius: 99px;
150
+ color: var(--accent);
151
+ border: 1px solid var(--line-strong);
152
+ background: var(--accent-dim);
153
+ font-size: .84rem;
154
+ font-weight: 700;
155
+ }
156
+
157
+ /* Library */
54
158
  .library-toolbar { align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 26px; flex-wrap: wrap; }
55
- .lib-search-input { min-width: 240px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; font: inherit; background: #fff; }
159
+ .lib-search-input {
160
+ min-width: 240px;
161
+ padding: 12px 14px;
162
+ border: 1px solid var(--line-strong);
163
+ border-radius: 9px;
164
+ font: inherit;
165
+ color: var(--text);
166
+ background: #0c1524;
167
+ outline: none;
168
+ transition: border-color .2s, box-shadow .2s;
169
+ }
170
+ .lib-search-input::placeholder { color: var(--muted); }
171
+ .lib-search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
56
172
  .lib-filters { display: flex; gap: 8px; flex-wrap: wrap; }
57
- .lib-filter { padding: 8px 12px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); background: #fff; cursor: pointer; text-transform: capitalize; }
58
- .lib-filter.is-active, .lib-filter:hover { color: #fff; border-color: var(--accent-dark); background: var(--accent-dark); }
173
+ .lib-filter {
174
+ padding: 8px 12px;
175
+ border: 1px solid var(--line-strong);
176
+ border-radius: 99px;
177
+ color: var(--muted);
178
+ background: transparent;
179
+ cursor: pointer;
180
+ font: inherit;
181
+ font-size: .86rem;
182
+ text-transform: capitalize;
183
+ transition: all .2s;
184
+ }
185
+ .lib-filter.is-active, .lib-filter:hover { color: #04140f; border-color: var(--accent); background: var(--accent); box-shadow: 0 6px 18px var(--accent-glow); }
59
186
  .lib-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
60
187
  .library-card-top { min-height: 102px; }
61
- .library-card pre { overflow: auto; margin: 18px -8px -8px; padding: 16px; border-radius: 9px; color: #e8f5ef; background: #10263f; font-size: .82rem; }
188
+ .library-card pre {
189
+ overflow: auto;
190
+ margin: 18px -8px -8px;
191
+ padding: 16px;
192
+ border-radius: 9px;
193
+ color: #d7f6ea;
194
+ background: #0a101d;
195
+ border: 1px solid var(--line);
196
+ font-size: .82rem;
197
+ }
62
198
  .lib-empty { color: var(--muted); }
199
+
63
200
  .split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
64
- .site-footer { padding: 28px 0; color: #eaf5f1; background: var(--navy); }
201
+ .site-footer { padding: 28px 0; color: var(--muted); border-top: 1px solid var(--line); background: rgba(7, 12, 22, .8); }
65
202
  .footer-bottom { justify-content: space-between; gap: 16px; }
66
203
  .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
67
204
 
205
+ ::selection { color: #04140f; background: var(--accent); }
206
+ textarea, input { caret-color: var(--accent); }
207
+
208
+ @media (prefers-reduced-motion: reduce) {
209
+ html { scroll-behavior: auto; }
210
+ * { animation: none !important; transition: none !important; }
211
+ .info-card:hover, .feature-card:hover, .library-card:hover { transform: none; }
212
+ }
213
+
68
214
  @media (max-width: 760px) {
69
215
  .nav-inner { align-items: flex-start; padding: 14px 0; }
70
216
  .nav-links { gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.3-beta: provider-backed AI works in ordinary programs.
1
+ // PlainScript 1.0.3: provider-backed AI works in ordinary programs.
2
2
 
3
3
  remember answer as chatWith("groq", "llama-3.3-70b-versatile", "Explain PlainScript in one sentence")
4
4
  show answer
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.3-beta: array literals and indexing.
1
+ // PlainScript 1.0.3: array literals and indexing.
2
2
  remember values as [1, 2, 3]
3
3
  show values[0]
4
4
  show length(values)
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.3-beta: asynchronous work and error recovery.
1
+ // PlainScript 1.0.3: asynchronous work and error recovery.
2
2
 
3
3
  make loadProfile(id)
4
4
  wait for sleep(10)
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.3-beta: protected API route.
1
+ // PlainScript 1.0.3: protected API route.
2
2
  web app
3
3
  require api key from env("API_KEY")
4
4
  route get "/private"
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.3-beta: API keys, sessions, cookies, and auth helpers.
1
+ // PlainScript 1.0.3: API keys, sessions, cookies, and auth helpers.
2
2
 
3
3
  web app
4
4
  enable sessions "development-only-session-secret"
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.3-beta: variables, values, and output.
1
+ // PlainScript 1.0.3: variables, values, and output.
2
2
 
3
3
  remember name as "Ada"
4
4
  remember visitCount as 3
package/examples/bots.pln CHANGED
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.3-beta: Telegram bot handlers.
1
+ // PlainScript 1.0.3: Telegram bot handlers.
2
2
 
3
3
  bot env("TELEGRAM_BOT_TOKEN")
4
4
 
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.3-beta: cache and background work.
1
+ // PlainScript 1.0.3: cache and background work.
2
2
  cache env("REDIS_URL")
3
3
  cacheSet("status", "ready", 60)
4
4
  remember status as cacheGet("status")
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.3-beta: cache values and scheduled work.
1
+ // PlainScript 1.0.3: cache values and scheduled work.
2
2
 
3
3
  cache "redis://localhost:6379"
4
4
 
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.3-beta: lists, objects, and collection helpers.
1
+ // PlainScript 1.0.3: lists, objects, and collection helpers.
2
2
 
3
3
  remember numbers as list with 4, 7, 2, 9
4
4
  gather each number in numbers giving number * 2
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.3-beta: parallel operations and timeouts.
1
+ // PlainScript 1.0.3: parallel operations and timeouts.
2
2
 
3
3
  make firstJob()
4
4
  wait for sleep(10)
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.3-beta: conditions and string predicates.
1
+ // PlainScript 1.0.3: conditions and string predicates.
2
2
 
3
3
  remember score as 87
4
4
  remember label as "PlainScript"
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.3-beta: SQLite database.
1
+ // PlainScript 1.0.3: SQLite database.
2
2
  database "app.db" using "wasm"
3
3
  execute
4
4
  CREATE TABLE IF NOT EXISTS notes (body TEXT)
package/examples/day2.pln CHANGED
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.3-beta: conditional blocks.
1
+ // PlainScript 1.0.3: conditional blocks.
2
2
  remember age as 21
3
3
  if age is at least 18
4
4
  show "adult"
package/examples/day3.pln CHANGED
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.3-beta: functions.
1
+ // PlainScript 1.0.3: functions.
2
2
  make greet(name)
3
3
  give `Hello, ${name}!`
4
4
  done
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.3-beta: production-shaped web entry point.
1
+ // PlainScript 1.0.3: production-shaped web entry point.
2
2
  web app
3
3
  route get "/health"
4
4
  reply "ok"
@@ -1,3 +1,3 @@
1
- // PlainScript 1.0.3-beta: email application placeholder.
1
+ // PlainScript 1.0.3: email application placeholder.
2
2
  remember recipient as "team@example.com"
3
3
  show `mail queued for ${recipient}`
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.3-beta: recovery and cleanup.
1
+ // PlainScript 1.0.3: recovery and cleanup.
2
2
  try
3
3
  show "work"
4
4
  recover as error
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.3-beta: expression operators.
1
+ // PlainScript 1.0.3: expression operators.
2
2
  remember sumValue as (2 + 3) * 4
3
3
  if sumValue is 20
4
4
  show "exact"
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.3-beta: upload route.
1
+ // PlainScript 1.0.3: upload route.
2
2
  web app
3
3
  accept uploads limit "5 MB" allow list with "image/png" folder "uploads"
4
4
  route post "/upload"
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.3-beta: files and environment configuration.
1
+ // PlainScript 1.0.3: files and environment configuration.
2
2
  remember filename as env("CONFIG_FILE")
3
3
  if filename is null
4
4
  remember filename as "config.json"
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.3-beta: file and path operations.
1
+ // PlainScript 1.0.3: file and path operations.
2
2
 
3
3
  remember report as readFile("README.md")
4
4
  show length(report)
@@ -1,4 +1,4 @@
1
- // PlainScript 1.0.3-beta: a complete authenticated SQLite API.
1
+ // PlainScript 1.0.3: a complete authenticated SQLite API.
2
2
 
3
3
  web app
4
4
  database ":memory:" using "wasm"