/* Luanode design system
   ──────────────────────
   One CSS file shared by every page. Override the custom
   properties in `:root` to re-skin the whole site. */

:root {
    /* Palette — friendly + bright, but not childish */
    --bg: #fafbff;
    --bg-soft: #f4f6ff;
    --bg-card: #ffffff;
    --bg-deep: #1a1a2e;

    --text: #1a1a2e;
    --text-muted: #6b7280;
    --text-soft: #94a3b8;
    --text-inverse: #fafbff;

    --primary: #6366f1;        /* indigo */
    --primary-dark: #4f46e5;
    --primary-soft: #eef2ff;

    --accent: #ec4899;         /* pink */
    --accent-dark: #db2777;

    --success: #22c55e;
    --warn: #f59e0b;
    --danger: #ef4444;

    /* Script-class accents (match the Studio plugin) */
    --c-script: #f97316;       /* orange */
    --c-localscript: #3b82f6;  /* blue   */
    --c-modulescript: #22c55e; /* green  */
    --c-folder: #94a3b8;       /* grey   */

    --border: #e5e7eb;
    --border-strong: #d1d5db;

    /* Type */
    --font-sans: "Plus Jakarta Sans", "Inter",
        -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, sans-serif;
    --font-mono: "JetBrains Mono", "Fira Code", Consolas,
        "Courier New", monospace;

    /* Spacing scale */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-6: 24px;
    --space-8: 32px;
    --space-12: 48px;
    --space-16: 64px;
    --space-24: 96px;

    /* Radii + shadows */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.10);
    --shadow-glow: 0 8px 32px rgba(99, 102, 241, 0.18);

    /* Layout */
    --content-max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
    line-height: 1.2;
    margin: 0 0 var(--space-4) 0;
    letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); font-weight: 700; }
h3 { font-size: 1.3rem; font-weight: 700; }

p { margin: 0 0 var(--space-4) 0; }
ul, ol { margin: 0 0 var(--space-4) 0; padding-left: var(--space-6); }

code {
    font-family: var(--font-mono);
    font-size: 0.92em;
    background: var(--bg-soft);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    color: var(--primary-dark);
}
pre {
    background: var(--bg-deep);
    color: var(--text-inverse);
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    line-height: 1.55;
}
pre code {
    background: none;
    color: inherit;
    padding: 0;
}

/* ── Layout containers ─────────────────────────────────── */

.container {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.container-narrow {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

section {
    padding: var(--space-16) 0;
}
.section-soft { background: var(--bg-soft); }
.section-deep {
    background: var(--bg-deep);
    color: var(--text-inverse);
}
.section-deep h1, .section-deep h2, .section-deep h3 {
    color: var(--text-inverse);
}
.section-deep p { color: rgba(250, 251, 255, 0.78); }

/* ── Header ──────────────────────────────────────────── */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(250, 251, 255, 0.85);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--text);
    text-decoration: none;
}
.brand-mark {
    width: 32px;
    height: 32px;
}
.nav-links {
    display: flex;
    gap: var(--space-6);
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav-links a {
    color: var(--text-muted);
    font-weight: 500;
    text-decoration: none;
    font-size: 0.95rem;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--primary); }

.nav-toggle {
    display: none;
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text);
    padding: var(--space-2);
}

@media (max-width: 720px) {
    .nav-toggle { display: block; }
    .nav-links {
        position: fixed;
        top: 64px; left: 0; right: 0;
        background: var(--bg-card);
        flex-direction: column;
        align-items: flex-start;
        padding: var(--space-6);
        border-bottom: 1px solid var(--border);
        transform: translateY(-150%);
        transition: transform 200ms ease-out;
    }
    .nav-links.open { transform: translateY(0); }
}

/* ── Buttons ─────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 10px 18px;
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 120ms ease, box-shadow 120ms ease,
                background 120ms ease;
    white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-glow);
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-accent {
    background: var(--accent);
    color: white;
}
.btn-accent:hover { background: var(--accent-dark); }

.btn-outline {
    background: transparent;
    color: var(--text);
    border-color: var(--border-strong);
}
.btn-outline:hover {
    background: var(--bg-soft);
    color: var(--primary);
}

.btn-ghost {
    background: transparent;
    color: var(--primary);
}
.btn-ghost:hover { background: var(--primary-soft); }

.btn-lg {
    padding: 14px 26px;
    font-size: 1.05rem;
    border-radius: 12px;
}
.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-group {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
}

/* ── Hero ─────────────────────────────────────────────── */

.hero {
    padding: var(--space-24) 0 var(--space-16);
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: "";
    position: absolute;
    top: -200px; left: 50%;
    transform: translateX(-50%);
    width: 1000px; height: 600px;
    background: radial-gradient(
        ellipse at center,
        rgba(99, 102, 241, 0.18) 0%,
        rgba(236, 72, 153, 0.10) 35%,
        transparent 70%);
    z-index: 0;
    pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.eyebrow {
    display: inline-block;
    padding: 6px 14px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: var(--space-6);
}
.hero h1 {
    max-width: 880px;
    margin-left: auto;
    margin-right: auto;
}
.hero .lede {
    max-width: 640px;
    margin: 0 auto var(--space-8);
    font-size: 1.2rem;
    color: var(--text-muted);
}
.hero .btn-group { justify-content: center; }

.gradient-text {
    background: linear-gradient(
        135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* ── Section heading ─────────────────────────────────── */

.section-head {
    text-align: center;
    margin-bottom: var(--space-12);
}
.section-head .eyebrow { margin-bottom: var(--space-4); }
.section-head h2 { max-width: 720px; margin: 0 auto var(--space-4); }
.section-head .lede {
    max-width: 600px;
    margin: 0 auto;
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* ── Cards ───────────────────────────────────────────── */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-6);
}
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    box-shadow: var(--shadow-sm);
    transition: transform 160ms ease, box-shadow 160ms ease;
}
.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}
.card .card-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: var(--space-4);
}
.card h3 { margin-bottom: var(--space-2); }
.card p {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.97rem;
}

/* Coloured card-icon variants */
.icon-indigo { background: #eef2ff; color: #4f46e5; }
.icon-pink   { background: #fce7f3; color: #db2777; }
.icon-amber  { background: #fef3c7; color: #d97706; }
.icon-green  { background: #dcfce7; color: #16a34a; }
.icon-blue   { background: #dbeafe; color: #2563eb; }
.icon-purple { background: #f3e8ff; color: #9333ea; }

/* ── Steps ───────────────────────────────────────────── */

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-8);
    counter-reset: step;
}
.step {
    counter-increment: step;
    padding: var(--space-6);
    position: relative;
}
.step::before {
    content: counter(step);
    position: absolute;
    top: 0; left: var(--space-6);
    width: 36px; height: 36px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.05rem;
    box-shadow: var(--shadow-glow);
}
.step h3 { margin-top: var(--space-12); margin-bottom: var(--space-2); }
.step p { color: var(--text-muted); margin: 0; }

/* ── Forms ───────────────────────────────────────────── */

.form-row {
    display: flex;
    gap: var(--space-2);
    max-width: 480px;
    margin: 0 auto;
}
.form-row input[type="email"] {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    background: var(--bg-card);
    color: var(--text);
}
.form-row input[type="email"]:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-color: var(--primary);
}
.form-row button {
    flex-shrink: 0;
}
.form-note {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: var(--space-3);
}

.form-status {
    text-align: center;
    margin-top: var(--space-3);
    font-size: 0.9rem;
}
.form-status.success { color: var(--success); }
.form-status.error { color: var(--danger); }

/* ── Stats strip ─────────────────────────────────────── */

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--space-6);
    text-align: center;
}
.stat .stat-value {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: var(--space-2);
}
.section-deep .stat .stat-value {
    color: white;
    background: linear-gradient(
        135deg, var(--text-inverse), #c7d2fe);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.stat .stat-label {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
}
.section-deep .stat .stat-label {
    color: rgba(250, 251, 255, 0.7);
}

/* ── Outliner mockup (decorative) ─────────────────────── */

.mockup {
    background: var(--bg-deep);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    color: var(--text-inverse);
    padding: var(--space-4);
    margin: 0 auto;
    max-width: 880px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}
.mockup-titlebar {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: var(--space-3);
}
.mockup-dot {
    width: 12px; height: 12px; border-radius: 50%;
    background: #4a4a5e;
}
.mockup-dot.red    { background: #ef4444; }
.mockup-dot.yellow { background: #f59e0b; }
.mockup-dot.green  { background: #22c55e; }
.mockup-title {
    color: rgba(250, 251, 255, 0.6);
    font-size: 0.78rem;
    margin-left: var(--space-3);
    font-family: var(--font-sans);
}
.mockup-row {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: var(--space-3);
}
.mockup-tree {
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-sm);
    padding: var(--space-3);
}
.tree-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 4px;
    border-radius: 4px;
    color: rgba(250, 251, 255, 0.78);
    font-size: 0.8rem;
}
.tree-item.svc {
    color: #c4b5fd;
    font-weight: 600;
    margin-top: var(--space-2);
}
.tree-item.svc:first-child { margin-top: 0; }
.tree-item .badge {
    display: inline-block;
    width: 14px; text-align: center;
    font-weight: 700;
    font-size: 0.7rem;
    border-radius: 3px;
    padding: 1px 0;
    background: rgba(255, 255, 255, 0.06);
}
.tree-item .badge.s { color: var(--c-script); }
.tree-item .badge.l { color: var(--c-localscript); }
.tree-item .badge.m { color: var(--c-modulescript); }
.tree-item .badge.f { color: var(--c-folder); }
.tree-item.child { padding-left: 22px; }

.mockup-code {
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-sm);
    padding: var(--space-4);
    line-height: 1.55;
    color: #e2e8f0;
    /* Preserve newlines + indentation in the source code
       block; without this, the browser collapses them and the
       Lua snippet renders as a single squashed line. */
    white-space: pre-wrap;
    overflow-x: auto;
    tab-size: 4;
    font-size: 0.82rem;
}
.mockup-code .kw { color: #c4b5fd; }
.mockup-code .str { color: #86efac; }
.mockup-code .num { color: #fcd34d; }
.mockup-code .com { color: #64748b; font-style: italic; }

/* ── Tags / pills ────────────────────────────────────── */

.pill {
    display: inline-block;
    background: var(--bg-soft);
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 500;
    border: 1px solid var(--border);
}
.pill-primary {
    background: var(--primary-soft);
    color: var(--primary-dark);
    border-color: transparent;
}
.pill-success {
    background: #dcfce7;
    color: #16a34a;
    border-color: transparent;
}

/* ── Docs / content pages ────────────────────────────── */

.content {
    max-width: 760px;
    margin: 0 auto;
}
.content h1 { margin-top: 0; }
.content h2 {
    margin-top: var(--space-12);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--border);
}
.content h3 { margin-top: var(--space-8); }
.content > p, .content > ul, .content > ol {
    color: var(--text);
}
.content blockquote {
    margin: var(--space-6) 0;
    padding: var(--space-4) var(--space-6);
    background: var(--primary-soft);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-sm);
    color: var(--text);
}
.content blockquote p:last-child { margin: 0; }

.toc {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-4) var(--space-6);
    margin-bottom: var(--space-8);
}
.toc h4 {
    margin: 0 0 var(--space-2);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.toc ul { margin: 0; padding-left: var(--space-6); }
.toc li { font-size: 0.95rem; }

/* ── Footer ──────────────────────────────────────────── */

.site-footer {
    background: var(--bg-deep);
    color: rgba(250, 251, 255, 0.78);
    padding: var(--space-16) 0 var(--space-8);
}
.site-footer .container {
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: var(--space-8);
}
.site-footer .brand {
    color: var(--text-inverse);
}
.site-footer h4 {
    color: var(--text-inverse);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: var(--space-4);
}
.site-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.site-footer li { margin-bottom: var(--space-2); }
.site-footer a {
    color: rgba(250, 251, 255, 0.7);
}
.site-footer a:hover {
    color: var(--text-inverse);
    text-decoration: none;
}
.site-footer .copy {
    grid-column: 1 / -1;
    margin-top: var(--space-8);
    padding-top: var(--space-6);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(250, 251, 255, 0.5);
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-3);
}

@media (max-width: 720px) {
    .site-footer .container {
        grid-template-columns: 1fr 1fr;
    }
}

/* ── Utility ──────────────────────────────────────────── */

.center { text-align: center; }
.muted { color: var(--text-muted); }
.mt-0 { margin-top: 0; }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-0 { margin-bottom: 0; }

.hidden { display: none; }

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
    html { scroll-behavior: auto; }
}
