{"version":3,"file":"nuclo.logo.cjs","names":["ic","PI","lap","t","i","d","rawShape","rawPlay","rawHub","placeIcon","place","pts","x","y","cx","s","cy","a","kern","line","x1","x0","y1","y0","arc","rad","to","from","trace","L","segs","sum","done","n","arch","up","c","end","rx","open","fo","fi","at","ang","cut","r0","r1","corner","cr","pill","ring","letters","xs","p","ys","S","brandIcon","glyphs","glyph","w","contours","box","margin","brandBox","pathD","k","v","GRADIENT","STROKE","INK_SET","instances","nucloLogo","mods","id","width","height","sw","piece","start","letter","pieces","wheel","total","now","paint","seg","draw","animate","raf","frame","ms","pen","arm"],"sources":["../../src/logo/geometry.ts","../../src/logo/index.ts"],"sourcesContent":["// The Nuclo mark and wordmark as point lists: pure math, no DOM. The components\n// draw them and scripts/render-brand.ts writes the static SVG and PNG assets\n// from them, so every logo on the site comes from this one source.\n\nexport const N = 360; // points per contour. One wheel lap draws the icon; each pen draws its glyph in the same N steps\nconst PI = Math.PI;\n\n// ── The icon: a hypotrochoid with two pens on one wheel ──────────────────\nexport const R = 96; // the fixed ring\nexport const r = 32; // the rolling wheel. R / r = 3 gives three lobes\nconst outer = 90; // the shape's pen. d > r: the lobes overlap\nconst inner = 12; // the play triangle's pen. d < r: a rounded triangle\n\n// One lap of a pen at distance d from the wheel's center, around the origin\nconst lap = (d: number) =>\n  Array.from({ length: N + 1 }, (_, i) => {\n    const t = (i / N) * 2 * PI;\n    return [(R - r) * Math.cos(t) + d * Math.cos(((R - r) / r) * t), (R - r) * Math.sin(t) - d * Math.sin(((R - r) / r) * t)];\n  });\nconst rawShape = lap(outer);\nconst rawPlay = lap(inner);\nconst rawHub = lap(0);\n\nexport type Icon = { hub: number[][]; shape: number[][]; play: number[][]; cx: number; cy: number; ring: number; wheel: number };\n\n/** The icon scaled by s with the wheel's center at (cx, cy). */\nexport function placeIcon(s: number, cx: number, cy: number): Icon {\n  const place = (pts: number[][]) => pts.map(([x, y]) => [cx + s * x, cy + s * y]);\n  return { hub: place(rawHub), shape: place(rawShape), play: place(rawPlay), cx, cy, ring: R * s, wheel: r * s };\n}\n\n/** The icon alone in a 200 × 200 box, the outer pen touching the box's margin. */\nexport const icon = placeIcon(88 / (R - r + outer), 100, 100);\n\n// ── The wordmark on its unit grid. U is the module; the sizes are multiples of it ──\nconst U = 24;\nconst stem = U; // every stroke, straight or round, is one unit thick\nconst xh = 6 * U; // x-height\nconst pad = 2 * U;\nconst base = 9 * U + pad; // the baseline. The l is 9 units tall\nconst top = base - xh; // the x-height line\nconst mid = top + xh / 2;\nconst ovr = 4; // round forms overshoot the x-height and the baseline, so they look aligned\nconst ro = xh / 2 + ovr; // outer radius of c and o\nconst ri = ro - stem; // their counter\nconst A = 2.5 * U; // arch radius of n and u: narrower than the bowls\nconst lw = stem + 2; // the l is two units wider: a lone stem with round ends looks lighter\nconst a = (34 * PI) / 180; // half of the c's opening\n// The space between the inks of each pair, set by eye: n–u, u–c, c–l, l–o\nconst kern = [36, 27, 20, 25];\n\n// Each contour is a chain of lines and arcs. Angles turn counterclockwise and 0 points right\ntype Seg = { len: number; at: (t: number) => number[] };\nconst line = (x0: number, y0: number, x1: number, y1: number): Seg => ({\n  len: Math.hypot(x1 - x0, y1 - y0),\n  at: (t) => [x0 + (x1 - x0) * t, y0 + (y1 - y0) * t],\n});\nconst arc = (cx: number, cy: number, rad: number, from: number, to: number): Seg => ({\n  len: rad * Math.abs(to - from),\n  at: (t) => [cx + rad * Math.cos(from + (to - from) * t), cy - rad * Math.sin(from + (to - from) * t)],\n});\n// N + 1 points along the chain, the same distance apart\nconst trace = (segs: Seg[]) => {\n  const L = segs.reduce((sum, s) => sum + s.len, 0);\n  let i = 0;\n  let done = 0;\n  return Array.from({ length: N + 1 }, (_, n) => {\n    const d = (n / N) * L;\n    while (i < segs.length - 1 && done + segs[i].len < d) done += segs[i++].len;\n    return segs[i].at((d - done) / segs[i].len);\n  });\n};\n\n// n: two stems and an arch over the top. u: the same glyph, arch under the bottom\nconst arch = (x: number, up: boolean) => {\n  const y = up ? base : top; // where the stems end, flat on the line\n  const c = up ? top + A - ovr : base - A + ovr; // the arch's center. The arch overshoots the line like the o does\n  const end = up ? 0 : 2 * PI; // the arch turns over the top, or under the bottom\n  const rx = x + 2 * A;\n  return trace([\n    line(x, y, x, c),\n    arc(x + A, c, A, PI, end),\n    line(rx, c, rx, y),\n    line(rx, y, rx - stem, y),\n    line(rx - stem, y, rx - stem, c),\n    arc(x + A, c, A - stem, end, PI),\n    line(x + stem, c, x + stem, y),\n    line(x + stem, y, x, y),\n  ]);\n};\n// c: the o cut open on the right, 34° above and below the center line. The cuts point at the center.\n// Their four corners are rounded by q, so the cut ends sit with the pill of the l\nconst open = (cx: number) => {\n  const q = 3;\n  const fo = Math.asin(q / (ro - q)); // where a corner arc meets the outer circle, from the cut\n  const fi = Math.asin(q / (ri + q)); // and the inner circle\n  const at = (rad: number, ang: number): [number, number] => [cx + rad * Math.cos(ang), mid - rad * Math.sin(ang)];\n  const cut = (r0: number, r1: number, ang: number) => line(...at(r0, ang), ...at(r1, ang));\n  const corner = (cr: number, ang: number, from: number, to: number) => arc(...at(cr, ang), q, from, to);\n  return trace([\n    arc(cx, mid, ro, a + fo, 2 * PI - a - fo), // the outer curve, over the top and down the left\n    corner(ro - q, -a - fo, -a - fo, -a + PI / 2), // the lower cut: outer corner,\n    cut((ro - q) * Math.cos(fo), (ri + q) * Math.cos(fi), -a), // the cut,\n    corner(ri + q, -a - fi, -a + PI / 2, -a - fi + PI), // inner corner\n    arc(cx, mid, ri, 2 * PI - a - fi, a + fi), // the counter, back up the left\n    corner(ri + q, a + fi, a + fi + PI, a + 1.5 * PI), // the upper cut: inner corner,\n    cut((ri + q) * Math.cos(fi), (ro - q) * Math.cos(fo), a), // the cut,\n    corner(ro - q, a + fo, a + 1.5 * PI, a + fo + 2 * PI), // outer corner\n  ]);\n};\n// l: a pill from the ascender line to the baseline. Its round ends overshoot both lines like the bowls do\nconst pill = (x: number) => {\n  const rad = lw / 2;\n  const y0 = base - 9 * U - ovr + rad; // the center of the top cap\n  const y1 = base + ovr - rad; // and of the bottom cap\n  return trace([arc(x + rad, y0, rad, PI, 0), line(x + lw, y0, x + lw, y1), arc(x + rad, y1, rad, 0, -PI), line(x, y1, x, y0)]);\n};\n// o: two circles. They run in opposite directions, so the fill leaves the counter open\nconst ring = (cx: number) => [trace([arc(cx, mid, ro, PI, 3 * PI)]), trace([arc(cx, mid, ri, PI, -PI)])];\n\n// Each letter: its contours at x, and the width of its ink. The c's ink stops at its terminals\nconst letters: [(x: number) => number[][][], number][] = [\n  [(x) => [arch(x, true)], 2 * A],\n  [(x) => [arch(x, false)], 2 * A],\n  [(x) => [open(x + ro)], ro + ro * Math.cos(a)],\n  [(x) => [pill(x)], lw],\n  [(x) => ring(x + ro), 2 * ro],\n];\n\n// ── The lockup: icon and wordmark on one baseline ────────────────────────\n// The icon is 1.45 x-heights tall, so it leads but does not overpower the word; its lowest lobe\n// touches the baseline; the n starts 1.5 stems after the tip of the right lobe\nconst xs = rawShape.map((p) => p[0]);\nconst ys = rawShape.map((p) => p[1]);\nconst S = (1.45 * xh) / (Math.max(...ys) - Math.min(...ys));\nexport const brandIcon = placeIcon(S, pad - S * Math.min(...xs), base - S * Math.max(...ys));\n\nlet x = brandIcon.cx + S * Math.max(...xs) + 1.5 * stem;\n/** The wordmark: one list of contours per letter. */\nexport const glyphs = letters.map(([glyph, w], i) => {\n  const contours = glyph(x);\n  x += w + (kern[i] ?? 0);\n  return contours;\n});\n\n/** The box around a drawing: [x, y, width, height], with room for the pens that ride the outlines. */\nexport function box(contours: number[][][], margin = 5): [number, number, number, number] {\n  const pts = contours.flat();\n  const x0 = Math.floor(Math.min(...pts.map((p) => p[0])) - margin);\n  const y0 = Math.floor(Math.min(...pts.map((p) => p[1])) - margin);\n  const x1 = Math.ceil(Math.max(...pts.map((p) => p[0])) + margin);\n  const y1 = Math.ceil(Math.max(...pts.map((p) => p[1])) + margin);\n  return [x0, y0, x1 - x0, y1 - y0];\n}\nexport const brandBox = box([brandIcon.shape, ...glyphs.flat()]);\n\n/** The path of the first k points of each contour, closed once the contour is complete. */\nexport const pathD = (contours: number[][][], k = N) =>\n  contours.map((pts) => \"M\" + pts.slice(0, k + 1).map((p) => p.map((v) => Math.round(v * 10) / 10).join(\",\")).join(\"L\") + (k === N ? \"Z\" : \"\")).join(\"\");\n\nexport const GRADIENT = { from: \"#ea3f25\", to: \"#ed6a2c\" };\nexport const INK = \"#111\";\nexport const STROKE = \"#f26a2e\";\n","/**\n * nuclo/nuclo-logo — the Nuclo logo (mark and name) as a nuclo component, drawn the\n * way nuclo.dev draws it: a Spirograph wheel rolls inside a ring and its two pens\n * trace the mark; then a pen writes each letter, n to o, each inking as the next begins.\n *\n *   import nucloLogo from \"nuclo/nuclo-logo\";\n *   main(nucloLogo({ height: 48 }));\n *\n * Its own entry, so apps that never show the logo never ship it. It builds on the\n * runtime's globals (svgSvg, scope, update, …), so the app imports \"nuclo\" as usual.\n * The svg starts finished, which is what SSR sends; on mount it is drawn again unless\n * `animate` is off or the visitor prefers reduced motion.\n */\nimport { brandBox, brandIcon as ic, glyphs, pathD, GRADIENT, INK, N, STROKE } from \"./geometry\";\n\nexport type NucloLogoOptions = {\n\t/** Height in px; the width follows the logo's proportions. Default 32. */\n\theight?: number;\n\t/** Draw the logo when it mounts. Default true. */\n\tanimate?: boolean;\n};\n\nconst ICON_DRAW = 1.4; // seconds the wheel takes\nconst LETTER_DRAW = 0.6; // seconds a pen takes per letter\nconst LEAD = 0.2; // how early each letter starts, before the last one ends\nconst INK_SET = 0.2; // seconds the ink takes to set, once the pen has closed the outline\n\n// One drawn thing: its contours, its fill and when its pen runs. k is how many points are drawn, ink its fill\ntype Piece = { contours: number[][][]; fill: string; start: number; end: number; letter: boolean; k: number; ink: number };\n\nlet instances = 0;\n\nexport default function nucloLogo({ height = 32, animate = true }: NucloLogoOptions = {}, ...mods: SVGElementModifierLike<\"svg\">[]) {\n\tconst id = `nuclo-logo-${instances++}`;\n\tconst width = Math.round((height * brandBox[2]) / brandBox[3]);\n\tconst sw = +(1.2 / (width / brandBox[2])).toFixed(2); // a ~1.2px pen line whatever the size\n\n\tconst piece = (contours: number[][][], fill: string, start: number, letter = false): Piece =>\n\t\t({ contours, fill, start, end: start + (letter ? LETTER_DRAW : ICON_DRAW), letter, k: N, ink: 1 });\n\tconst pieces = [\n\t\tpiece([ic.shape], `url(#${id}-fill)`, 0),\n\t\tpiece([ic.play], INK, 0),\n\t\t...glyphs.map((contours, i) => piece(contours, \"currentColor\", ICON_DRAW - LEAD + i * (LETTER_DRAW - LEAD), true)),\n\t];\n\tconst wheel = pieces[0];\n\tconst total = pieces[pieces.length - 1].end + INK_SET;\n\tlet now = total; // seconds into the drawing: the finished logo until it is drawn\n\n\tfunction paint() {\n\t\tconst seg = (from: number, to: number) => Math.min(1, Math.max(0, (now - from) / (to - from)));\n\t\tfor (const p of pieces) {\n\t\t\tp.k = Math.round((0.5 - Math.cos(Math.PI * seg(p.start, p.end)) / 2) * N);\n\t\t\tp.ink = seg(p.end, p.end + INK_SET); // fills only once the outline is closed\n\t\t}\n\t\tupdate(id);\n\t}\n\n\t// onMount runs before the first paint, so the finished logo never flashes\n\tfunction draw() {\n\t\tif (!animate || globalThis.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches) return;\n\t\tconst start = performance.now();\n\t\tlet raf = 0;\n\t\tconst frame = (ms: number) => {\n\t\t\tnow = Math.min(total, (ms - start) / 1000);\n\t\t\tpaint();\n\t\t\tif (now < total) raf = requestAnimationFrame(frame);\n\t\t};\n\t\tnow = 0;\n\t\tpaint();\n\t\traf = requestAnimationFrame(frame);\n\t\treturn () => cancelAnimationFrame(raf);\n\t}\n\n\t// A pen is on the page from the moment it starts until its ink has set\n\tconst pen = (p: Piece, pts: number[][]) =>\n\t\tcircleSvg({ cx: () => pts[p.k][0], cy: () => pts[p.k][1], r: 5, fill: \"currentColor\", stroke: STROKE, \"stroke-width\": 1.5, opacity: () => (now <= p.start ? 0 : 1 - p.ink) });\n\n\tconst arm = (p: Piece) =>\n\t\tlineSvg({ x1: () => ic.hub[p.k][0], y1: () => ic.hub[p.k][1], x2: () => p.contours[0][p.k][0], y2: () => p.contours[0][p.k][1] });\n\n\t// The line a pen has drawn so far. It fills when the contour closes\n\tconst trace = (p: Piece) =>\n\t\tpathSvg({ d: () => pathD(p.contours, p.k), fill: p.fill, \"fill-opacity\": () => p.ink, stroke: p.letter ? p.fill : STROKE, \"stroke-width\": sw, \"stroke-opacity\": () => (p.letter || p.ink < 1 ? 1 : 0) });\n\n\treturn svgSvg(\n\t\t{ viewBox: brandBox.join(\" \"), width, height, role: \"img\", \"aria-label\": \"Nuclo\", onMount: draw },\n\t\t...mods,\n\t\tscope(id),\n\t\tdefsSvg(\n\t\t\tlinearGradientSvg(\n\t\t\t\t{ id: `${id}-fill`, x1: 0, y1: 0, x2: 0, y2: 1 },\n\t\t\t\tstopSvg({ offset: \"0\", \"stop-color\": GRADIENT.from }),\n\t\t\t\tstopSvg({ offset: \"1\", \"stop-color\": GRADIENT.to }),\n\t\t\t),\n\t\t),\n\t\t// The ring, the wheel and its arms fade out as the mark's ink sets\n\t\tgSvg(\n\t\t\t{ fill: \"none\", stroke: STROKE, \"stroke-width\": sw, opacity: () => 1 - wheel.ink },\n\t\t\tcircleSvg({ cx: ic.cx, cy: ic.cy, r: ic.ring, \"stroke-opacity\": 0.25 }),\n\t\t\tcircleSvg({ cx: () => ic.hub[wheel.k][0], cy: () => ic.hub[wheel.k][1], r: ic.wheel }),\n\t\t\tarm(pieces[0]),\n\t\t\tarm(pieces[1]),\n\t\t),\n\t\t...pieces.map(trace),\n\t\t...pieces.flatMap((p) => p.contours.map((pts) => pen(p, pts))),\n\t);\n}\n"],"mappings":"AAKA,MAAMC,EAAK,KAAK,GASVC,EAAO,GACX,MAAM,KAAK,CAAE,OAAQ,GAAM,GAAI,EAAG,IAAM,CACtC,IAAMC,EAAKC,EAAA,IAAS,EAAIH,EACxB,MAAO,CAAE,GAAS,KAAK,IAAIE,CA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