/* ==========================================================================
   MockiFlo Global Styles & Unified Syntax Tokens
   ========================================================================== */

:root {
    --brand-accent: #8b181b;
    --brand-soft: rgba(139, 24, 27, 0.07);
    --brand-border: rgba(139, 24, 27, 0.14);

    /* Subtle Studio Sheen & Navbar Horizon Beam (Light Mode) */
    --studio-sheen: rgba(255, 255, 255, 0.78);
    --horizon-beam: linear-gradient(90deg, transparent 0%, rgba(15, 23, 42, 0.06) 35%, rgba(139, 24, 27, 0.16) 50%, rgba(15, 23, 42, 0.06) 65%, transparent 100%);

    /* Unified Syntax Highlighting Palette (Console, Playground & Payload Formatter) */
    --syntax-key: #101828;                        /* JSON object property keys */
    --syntax-string: #059669;                     /* JSON strings & XML attribute values */
    --syntax-number: #d97706;                     /* JSON numeric literals */
    --syntax-atom: #7c3aed;                       /* JSON boolean & null literals */
    --syntax-tag: #8b181b;                        /* XML element tags & angle brackets */
    --syntax-attr: #d97706;                       /* XML attribute names */
    --syntax-bracket: #101828;                    /* JSON structural braces & brackets */
    --syntax-punct: #98a2b3;                      /* JSON colons & commas */
    --syntax-text: #101828;                       /* XML element text content */
    --syntax-comment: #667085;                    /* XML comments, declarations & doctypes */
    --syntax-template: #8b181b;                   /* Dynamic template {{ ... }} expressions */
    --syntax-template-bg: rgba(139, 24, 27, 0.07);
}

html.dark {
    --brand-accent: #cf4448;
    --brand-soft: rgba(207, 68, 72, 0.12);
    --brand-border: rgba(207, 68, 72, 0.24);

    /* Subtle Studio Sheen & Navbar Horizon Beam (Dark Mode - Natural Crimson) */
    --studio-sheen: rgba(255, 255, 255, 0.022);
    --horizon-beam: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.06) 35%, rgba(207, 68, 72, 0.24) 50%, rgba(255, 255, 255, 0.06) 65%, transparent 100%);

    /* Unified Syntax Highlighting Palette */
    --syntax-key: #f4f4f5;
    --syntax-string: #34d399;
    --syntax-number: #fbbf24;
    --syntax-atom: #a78bfa;
    --syntax-tag: #fb7185;
    --syntax-attr: #fbbf24;
    --syntax-bracket: #f4f4f5;
    --syntax-punct: #71717a;
    --syntax-text: #f4f4f5;
    --syntax-comment: #71717a;
    --syntax-template: #fda4af;
    --syntax-template-bg: rgba(251, 113, 133, 0.12);
}

/* ==========================================================================
   Branded 44px Open-Corner Grid + Floating Crimson Pinpoints (Home, Pricing, Auth, 404)
   ========================================================================== */
.bg-grid-brand {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Cpath d='M5 0.5H39M0.5 5V39' fill='none' stroke='%231e293b' stroke-opacity='0.045' stroke-width='1' stroke-linecap='round'/%3E%3Ccircle cx='0' cy='0' r='1.15' fill='%238b181b' fill-opacity='0.15'/%3E%3Ccircle cx='44' cy='0' r='1.15' fill='%238b181b' fill-opacity='0.15'/%3E%3Ccircle cx='0' cy='44' r='1.15' fill='%238b181b' fill-opacity='0.15'/%3E%3Ccircle cx='44' cy='44' r='1.15' fill='%238b181b' fill-opacity='0.15'/%3E%3C/svg%3E");
    background-size: 44px 44px;
    background-position: center top;
    -webkit-mask-image: radial-gradient(ellipse 92% 78% at 50% 18%, #000 48%, rgba(0, 0, 0, 0.34) 80%, transparent 100%);
    mask-image: radial-gradient(ellipse 92% 78% at 50% 18%, #000 48%, rgba(0, 0, 0, 0.34) 80%, transparent 100%);
}

html.dark .bg-grid-brand {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Cpath d='M5 0.5H39M0.5 5V39' fill='none' stroke='%23ffffff' stroke-opacity='0.042' stroke-width='1' stroke-linecap='round'/%3E%3Ccircle cx='0' cy='0' r='1.15' fill='%23cf4448' fill-opacity='0.22'/%3E%3Ccircle cx='44' cy='0' r='1.15' fill='%23cf4448' fill-opacity='0.22'/%3E%3Ccircle cx='0' cy='44' r='1.15' fill='%23cf4448' fill-opacity='0.22'/%3E%3Ccircle cx='44' cy='44' r='1.15' fill='%23cf4448' fill-opacity='0.22'/%3E%3C/svg%3E");
}

/* Soft Neutral Studio Sheen at Top Horizon */
.bg-grid-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse 78% 42% at 50% 0%, var(--studio-sheen), transparent 75%);
}

/* Specular Horizon Line right beneath the Fixed Navbar */
.bg-grid-brand::after {
    content: "";
    position: absolute;
    top: 64px;
    left: 50%;
    transform: translateX(-50%);
    width: min(860px, 90vw);
    height: 1px;
    pointer-events: none;
    background: var(--horizon-beam);
}

/* Neutral Blueprint Grid Background (Console Radar & Studio Tools) */
.bg-grid-blueprint {
    background-image:
        linear-gradient(to right, rgba(16, 24, 40, 0.035) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(16, 24, 40, 0.035) 1px, transparent 1px);
    background-size: 44px 44px;
    background-position: center top;
}

html.dark .bg-grid-blueprint {
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
}

/* ==========================================================================
   Global Cross-Page Harmony Rules (Applies to all templates automatically)
   ========================================================================== */

/* Natural Crimson for Dark Mode text & icons (perceptual twin of #8b181b) */
html.dark .text-primary,
html.dark .group\/item:hover .group-hover\/item\:text-primary,
html.dark .text-\[\#8b181b\]:not([class*="dark:text-"]) {
    color: #cf4448;
}

html.dark .bg-primary-soft {
    background-color: rgba(207, 68, 72, 0.12);
}

html.dark .border-primary\/10 {
    border-color: rgba(207, 68, 72, 0.24);
}

/* Tactile card elevation in Dark Mode matching Light Mode's clean cards */
html.dark [class*="dark:bg-obsidian-card"] {
    border-color: rgba(255, 255, 255, 0.09);
    box-shadow:
        0 12px 28px -10px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.065);
}

/* Keep muted text & placeholders legible in Dark Mode */
html.dark .dark\:text-zinc-600 {
    color: #71717a;
}

html.dark .dark\:placeholder\:text-zinc-600::placeholder {
    color: #71717a;
}

/* Semantic Syntax Utility Classes (Used by json.js & xml.js) */
.syntax-key         { color: var(--syntax-key); }
.syntax-string      { color: var(--syntax-string); }
.syntax-number      { color: var(--syntax-number); }
.syntax-atom        { color: var(--syntax-atom); }
.syntax-tag         { color: var(--syntax-tag); }
.syntax-tag-bracket { color: var(--syntax-tag); }
.syntax-attr        { color: var(--syntax-attr); }
.syntax-bracket     { color: var(--syntax-bracket); }
.syntax-punct       { color: var(--syntax-punct); }
.syntax-text        { color: var(--syntax-text); }
.syntax-comment     { color: var(--syntax-comment); }
.syntax-template    { color: var(--syntax-template); background-color: var(--syntax-template-bg); border-radius: 3px; padding: 0 2px; }
