// styles.el - Page shell: DOCTYPE, <head>, CSS, and the minimal
// inline <script> for scroll-reveal and nav scroll effect.
//
// This file contains NO application logic - only the outer HTML
// document structure and presentation layer.
//
// CSS lives in dist/page_css.c (pre-compiled C function) to avoid
// elc tokenization bugs: # stripped as comments, spaces stripped
// between tokens, quotes stripped from font names, etc.
//
// Complex scripts (GA inline, JSON-LD schema) also live in pre-compiled
// C functions for the same reason.

// Pre-compiled C functions — bypass elc tokenizer for CSS and complex scripts
extern fn page_css() -> String
extern fn page_ga_script() -> String
extern fn page_schema() -> String

extern fn _page_close_impl() -> String

fn page_close() -> String {
    return _page_close_impl()
}

// el-html vessel — extern declarations (implementations in dist/elhtml_impl.c)
extern fn el_meta(name: String, content: String) -> String
extern fn el_meta_charset(charset: String) -> String
extern fn el_link_stylesheet(href: String) -> String
extern fn el_script_src(src: String, defer_load: Bool) -> String
extern fn el_script_inline(js: String) -> String
extern fn el_title(text: String) -> String

fn page_head() -> String {
    return el_meta_charset("UTF-8")
        + el_meta("viewport", "width=device-width, initial-scale=1.0")
        + el_title("Neuron - The AI That Remembers You")
        + el_meta("description", "Every AI resets when you close the tab. Neuron doesn't. Runs on your machine. Remembers everything. Cheaper than ChatGPT on day one.")
        + "<link rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/assets/favicon-16.png\">"
        + "<link rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/assets/favicon-32.png\">"
        + "<link rel=\"preconnect\" href=\"https://fonts.googleapis.com\">"
        + "<link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossorigin>"
        + el_link_stylesheet("https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;1,400;1,500&family=IBM+Plex+Sans:wght@300;400;500;600&display=swap")
        + page_css()
        + "<script src=\"https://cdn.jsdelivr.net/npm/marked/marked.min.js\" integrity=\"sha384-948ahk4ZmxYVYOc+rxN1H2gM1EJ2Duhp7uHtZ4WSLkV4Vtx5MUqnV+l7u9B+jFv+\" crossorigin=\"anonymous\"></script>"
        + "<script src=\"https://challenges.cloudflare.com/turnstile/v0/api.js\" async defer></script>"
        + "<noscript><style>.reveal { opacity: 1 !important; transform: none !important; }</style></noscript>"
        + "<script async src=\"https://www.googletagmanager.com/gtag/js?id=G-Y1EE43X9RN\"></script>"
        + page_ga_script()
        + "<meta property=\"og:type\" content=\"website\">"
        + "<meta property=\"og:url\" content=\"https://neurontechnologies.ai\">"
        + "<meta property=\"og:title\" content=\"Neuron - The AI That Remembers You\">"
        + "<meta property=\"og:description\" content=\"Every other AI forgets you. Neuron doesn&#39;t. Runs on your machine, builds a memory over time, and gets sharper the longer you use it. Built by one person. April 22, 2026 \xe2\x80\x94 the meeting. April 25 \xe2\x80\x94 you&#39;re looking at the proof.\">"
        + "<meta property=\"og:image\" content=\"https://neurontechnologies.ai/assets/brand/neuron-wordmark-on-light@2x.png\">"
        + "<meta name=\"twitter:card\" content=\"summary_large_image\">"
        + "<meta name=\"twitter:title\" content=\"Neuron - The AI That Remembers You\">"
        + "<meta name=\"twitter:description\" content=\"Every other AI forgets you. Neuron doesn&#39;t. Runs on your machine. Remembers everything. $19/mo or $199 founding member (first 1,000).\">"
        + "<meta name=\"twitter:image\" content=\"https://neurontechnologies.ai/assets/brand/neuron-wordmark-on-light@2x.png\">"
        + "<link rel=\"canonical\" href=\"https://neurontechnologies.ai\">"
        + page_schema()
}

fn page_open() -> String {
    return "<!DOCTYPE html><html lang=\"en\"><head>" + page_head() + "</head><body>"
}
