/* Ludexon color tokens, based on app.ludexon.com (theme.css).
   Every color on the site comes from a token below; other files only use var(--...).
   Dark is the default; the light palette applies with data-theme="light", which the inline
   script in index.html sets from the visitor's choice (navbar button) or the OS setting.
   site.webmanifest cannot read CSS, so its colors repeat --bg / --chrome-bg by hand. */

:root {
    color-scheme: dark;

    /* Page */
    --bg: #0F172A;
    --section-alt: rgba(var(--accent-rgb), .08);  /* Ecosystem band; translucent so the glows show */
    --text: #F1F5F9;
    --text-muted: #A5B4C8;
    --primary: #60A5FA;           /* links, bullets, icons */
    --primary-hover: #93C5FD;
    --accent-rgb: 96, 165, 250;   /* --primary as channels, for tints */
    --cta: #3B82F6;               /* buttons, founder email circles */
    --cta-hover: #2563EB;
    --cta-rgb: 59, 130, 246;
    --on-cta: #FFFFFF;
    --focus: #93C5FD;
    --shadow-rgb: 0, 0, 0;
    --logo-card: #FFFFFF;         /* partner logos are dark on white */

    /* Backdrop glows, from the palette's blues */
    --bg-glow-1: rgba(var(--cta-rgb), .22);
    --bg-glow-2: rgba(var(--accent-rgb), .10);
    --bg-glow-3: rgba(var(--accent-rgb), .06);

    /* Footer (contact section and the copyright strip) */
    --footer-bg: rgba(var(--accent-rgb), .06);
    --footer-bottom: rgba(var(--shadow-rgb), .3);

    /* Google Map */
    --map-land: #162033;
    --map-water: #0F172A;
    --map-road: #1E3A6B;
    --map-label: #A5B4C8;
    --map-label-stroke: #0F172A;

    /* Chrome: navbar and hero. Same in both themes because the logo is white and the hero
       image is dark. */
    --chrome-bg: #0F172A;
    --chrome-text: #F1F5F9;
    --chrome-text-rgb: 241, 245, 249;
}

:root[data-theme="light"] {
    color-scheme: light;

    --bg: #F6F4EF;
    --section-alt: rgba(var(--accent-rgb), .07);
    --text: #1F2933;
    --text-muted: #4A5260;
    --primary: #2563EB;
    --primary-hover: #1D4ED8;
    --accent-rgb: 37, 99, 235;
    --cta: #2563EB;
    --cta-hover: #1D4ED8;
    --cta-rgb: 37, 99, 235;
    --on-cta: #FFFFFF;
    --focus: #2563EB;
    --shadow-rgb: 15, 23, 42;
    --logo-card: #FFFFFF;

    --bg-glow-1: rgba(var(--cta-rgb), .28);
    --bg-glow-2: rgba(var(--accent-rgb), .12);
    --bg-glow-3: transparent;

    --footer-bg: rgba(var(--accent-rgb), .07);
    --footer-bottom: rgba(var(--accent-rgb), .12);

    --map-land: #E8ECF4;
    --map-water: #C7D5EC;
    --map-road: #FFFFFF;
    --map-label: #4A5260;
    --map-label-stroke: #F6F4EF;
}

/* Page backdrop: soft glows behind the content */
body {
    background-color: var(--bg);
    background-image:
        radial-gradient(60rem 40rem at 10% -10%, var(--bg-glow-1), transparent 60%),
        radial-gradient(50rem 36rem at 95% 15%, var(--bg-glow-2), transparent 60%),
        radial-gradient(44rem 32rem at 50% 110%, var(--bg-glow-3), transparent 60%);
    background-attachment: fixed;
    background-repeat: no-repeat;
}

.ts-on-cta {
    color: var(--on-cta);
}

/* Theme toggle in the navbar: shows the sun in dark mode, the moon in light mode */
.ts-theme-toggle {
    align-items: center;
    background: transparent;
    border: 1px solid rgba(var(--chrome-text-rgb), .25);
    border-radius: 50%;
    color: var(--chrome-text);
    cursor: pointer;
    display: inline-flex;
    height: 2.25rem;
    justify-content: center;
    transition: .3s ease;
    width: 2.25rem;
}

.ts-theme-toggle:hover {
    background-color: rgba(var(--chrome-text-rgb), .1);
    border-color: rgba(var(--chrome-text-rgb), .5);
}

.ts-theme-toggle .fa-moon,
:root[data-theme="light"] .ts-theme-toggle .fa-sun {
    display: none;
}

:root[data-theme="light"] .ts-theme-toggle .fa-moon {
    display: inline-block;
}

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

/* Bootstrap colors that show on the page, mapped to the tokens */

.navbar-dark .navbar-nav .nav-link {
    color: rgba(var(--chrome-text-rgb), .6);
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
    color: rgba(var(--chrome-text-rgb), .85);
}

.navbar-dark .navbar-nav .active > .nav-link,
.navbar-dark .navbar-nav .nav-link.active {
    color: var(--chrome-text);
}

.navbar-dark .navbar-toggler {
    border-color: rgba(var(--chrome-text-rgb), .15);
}

/* The hamburger icon is a mask so its color can be a token */
.navbar-dark .navbar-toggler-icon {
    background-color: rgba(var(--chrome-text-rgb), .6);
    background-image: none;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='black' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='black' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
