/* RoboStux — Modern Refresh (2025) with Theme Toggle */
/* Color Palette: https://coolors.co/a349a4-2fb7fc-0b0f14-ffffff
   Font: Space Grotesk (https://fonts.google.com/specimen/Space+Grotesk) - SIL Open Font License, self-hosted
   Icons: Font Awesome 7 Free (https://fontawesome.com/) - Free for commercial use, self-hosted
*/

@font-face {
    font-family: "Space Grotesk";
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url("fonts/space-grotesk-latin.woff2") format("woff2");
}

/* === CSS Variables for Theming === */
:root {
    --accent: #a349a4;
}

:root[data-theme="dark"] {
    --bg: #0b0f14;
    --surface: #121821;
    --muted: #1a2230;
    --text: #e9eef6;
    --text-dim: #b9c4d1;
    --primary: var(--accent);
    --primary-strong: #922b92;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

:root[data-theme="light"] {
    --bg: #f8fafc;
    --surface: #ffffff;
    --muted: #d5d5d5;
    --text: #0b1220;
    --text-dim: #49566a;
    --primary: var(--accent);
    --primary-strong: #7b297b;
    --shadow: 0 10px 30px rgba(2, 6, 23, .08);
}

/* Box sizing */
* {
    box-sizing: border-box
}

/* Full height for body and html */
html,
body {
    height: 100%;
    overflow-x: hidden;
}

/* Global styles */
body {
    margin: 0;
    font-family: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial;
    color: var(--text);
    background: var(--bg);
    line-height: 1.55;
    transition: background .3s, color .3s;
}

/* Container */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
    /* smaller padding for mobile */
}

/* Link styles */
a {
    color: var(--primary);
    text-decoration: none
}

a:hover {
    text-decoration: none;
}

/* Site banners (assets/site-banner.css) mapped to RoboStux: the dev-mode banner, and the
   other variants previewed with ?banner= in dev mode. The page scrolls the document, so the
   banner uses its sticky mode and the sticky header sits just below it (see .header). */
.site-banners {
    --banner-page-bg: var(--bg);
    --banner-text: var(--text);
    --banner-site: #d58ad6;
    --banner-site-light: #7b297b;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Header styles */
.header {
    position: sticky;
    top: var(--banner-h, 0px);
    z-index: 20;
    backdrop-filter: saturate(1.1) blur(10px);
    background: color-mix(in oklab, var(--bg) 95%, transparent);
    border-bottom: 1px solid color-mix(in oklab, var(--muted) 70%, transparent);
}

/* Navigation bar */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px
}

/* Brand logo and name */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700
}

.brand img {
    width: 28px;
    height: 28px;
    border-radius: 8px
}

/* Navigation links */
.navlinks {
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap
}

.navlinks a {
    color: var(--text-dim);
    padding: 8px 10px;
    border-radius: 10px
}

.navlinks a:hover {
    background: var(--muted);
    color: var(--text)
}

.navlinks i {
    margin-right: 6px;
    color: var(--primary);
}

/* Navigation buttons */
.navbuttons {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-direction: row;
}

.navbuttons .btn {
    padding: 6px 10px;
    font-size: 18px;
    line-height: 1;
}

.navbuttons .btn i {
    margin-right: 0px;
}

/* Mobile nav */
#menu-toggle {
    display: none;
    color: var(--accent)
}

#menu-toggle,
#theme-toggle {
    font-size: 20px;
}

/* Theme toggle button */
#theme-toggle .fa-moon {
    color: #4f2ff5;
}

#theme-toggle .fa-sun {
    color: #f5d42f;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    font-weight: 600;
    background: var(--primary);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: .2s
}

.btn.secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid color-mix(in oklab, var(--primary) 40%, var(--text) 60%)
}

.btn:hover {
    filter: saturate(1.05);
    /*box-shadow: 0 12px 34px rgba(0, 0, 0, .45)*/
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 6px rgba(163, 73, 164, .25)
}

.btn i {
    margin-right: 6px;
}

/* Sections */
.section {
    padding: 20px;
}

.section.hero {
    padding: 56px 0 24px
}

.section.hero .panel {
    background: var(--surface);
    border: 1px solid color-mix(in oklab, var(--muted) 70%, transparent);
    border-radius: 16px;
    padding: 28px;
    box-shadow: var(--shadow)
}

.section.features {
    padding: 20px;
}

.section.get-started {
    padding: 20px;
}

.section.privacy {
    padding: 20px;
}

.section.terms {
    padding: 20px;
}

.section.redirector {
    padding: 20px;
}

/* Prose styles for privacy and terms */
.section.prose {
    padding: 20px;
}

.section.prose h1,
.section.prose h2,
.section.prose h3 {
    line-height: 1.2;
    margin: 22px 0 10px
}

.section.prose p,
.section.prose li {
    color: var(--text-dim)
}

.section.prose code {
    background: var(--muted);
    padding: 2px 6px;
    border-radius: 8px
}

.section.prose h2 i {
    margin-right: 8px;
    color: var(--primary);
}

/* Badges */
.badge {
    display: inline-block;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: color-mix(in oklab, var(--accent) 25%, var(--muted) 75%);
    color: var(--text)
}

/* The hero eyebrow doubles as a live status badge (data-status-eyebrow, filled by assets/status-eyebrow.js):
   the badge's size and shape, a status colour and a dot, and only the state as its text. Until the status
   loads, or if it can't, it stays a plain eyebrow. */
:root,
:root[data-theme="dark"] {
    --status-up: #4ade80;
    --status-warn: #fbbf24;
    --status-down: #f87171;
}

:root[data-theme="light"] {
    --status-up: #15803d;
    --status-warn: #b45309;
    --status-down: #b91c1c;
}

a.badge[data-status-eyebrow] {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid transparent;
    text-decoration: none;
    transition: color .2s, background .2s, border-color .2s, filter .2s;
}

a.badge[data-status-eyebrow]:hover,
a.badge[data-status-eyebrow]:focus-visible {
    filter: brightness(1.12);
}

.badge.up { color: var(--status-up); background: color-mix(in oklab, var(--status-up) 12%, transparent); border-color: color-mix(in oklab, var(--status-up) 35%, transparent); }
.badge.degraded { color: var(--status-warn); background: color-mix(in oklab, var(--status-warn) 12%, transparent); border-color: color-mix(in oklab, var(--status-warn) 35%, transparent); }
.badge.down { color: var(--status-down); background: color-mix(in oklab, var(--status-down) 12%, transparent); border-color: color-mix(in oklab, var(--status-down) 40%, transparent); }

.badge.up::before,
.badge.degraded::before,
.badge.down::before {
    content: "";
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.badge.up::before { animation: status-pulse 2s ease-out infinite; }

@keyframes status-pulse {
    0% { box-shadow: 0 0 0 0 color-mix(in oklab, currentColor 60%, transparent); }
    70% { box-shadow: 0 0 0 6px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

.eyebrow-state[hidden],
.eyebrow-text[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
    .badge.up::before { animation: none; }
}

/* Headings and text */
.h1 {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    /* Responsive font size */
    line-height: 1.1;
    margin: 10px 0 8px
}

.lead {
    color: var(--text-dim);
    font-size: clamp(1rem, 2.5vw, 1.125rem);
    /* Responsive font size */
}

/* Call to action buttons */
.cta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px
}

/* KPI Section */
.kpis {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 22px 0 6px
}

.kpis .card {
    background: var(--surface);
    border: 1px solid color-mix(in oklab, var(--muted) 70%, transparent);
    border-radius: 14px;
    padding: 16px;
    text-align: center
}

.kpis .num {
    font-size: 28px;
    font-weight: 800
}

.kpis .label {
    color: var(--text-dim)
}

/* Grid layout for cards */
.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid color-mix(in oklab, var(--muted) 70%, transparent);
    border-radius: 14px;
    padding: 18px;
    box-shadow: var(--shadow)
}

.card h3 {
    margin: 6px 0 8px
}

.card h3 i {
    margin-right: 6px;
    color: var(--primary);
}

.card p {
    color: var(--text-dim)
}

/* Footer */
.footer {
    margin-top: 20px;
    color: var(--text-dim)
}

.footer .row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    border-top: 1px solid color-mix(in oklab, var(--muted) 70%, transparent);
    padding: 18px
}

.footer a {
    color: var(--text-dim)
}

.footer a:hover {
    color: var(--text)
}

.footer i {
    color: var(--primary);
}

.footer .copyright {
    display: flex;
    align-items: start;
    flex-direction: column;
}

.footer .copyright i {
    color: var(--primary);
}

.footer .copyright p {
    margin: 0 0 0 6px;
    font-size: 12px;
}

.footer .navlinks {
    font-size: 14px;
}

/* Tablet grid adjustments */
@media (max-width: 1024px) {
    .kpis {
        grid-template-columns: 1fr 1fr;
    }
}

/* Mobile menu styles */
@media (max-width: 768px) {
    .navlinks {
        display: none;
        flex-direction: column;
        background: var(--surface);
        position: absolute;
        top: 64px;
        right: 0;
        width: 220px;
        padding: 12px;
        box-shadow: var(--shadow);
    }

    .navlinks.active {
        display: flex;
    }

    #menu-toggle {
        display: block;
    }

    .footer .row {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer .copyright {
        align-items: center;
    }

    /* The header's mobile-menu rule above hides every .navlinks; the footer's stay visible. */
    .footer .navlinks {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px 16px;
        position: static;
        width: auto;
        padding: 0;
        background: none;
        box-shadow: none;
    }
}

/* Mobile grid adjustments */
@media (max-width: 640px) {

    .grid,
    .kpis {
        grid-template-columns: 1fr;
    }

    .cta {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        justify-content: center;
    }
}

/* Grid adjustments for tablets and mobiles */
@media(max-width:900px) {

    .grid,
    .kpis {
        grid-template-columns: 1fr 1fr
    }
}

@media(max-width:640px) {

    .grid,
    .kpis {
        grid-template-columns: 1fr
    }

    /*.h1 {
        font-size: 32px
    }*/
}

/* === Animations === */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .6s ease, transform .6s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.btn:hover {
    transform: translateY(-2px) scale(1.02);
}

.btn:active {
    transform: translateY(0) scale(0.98);
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.35;
    animation: blobMove 20s infinite ease-in-out;
    z-index: -1;
}

.blob.left {
    background: #a349a4;
    width: 300px;
    height: 300px;
    top: -100px;
    left: -100px;
}

.blob.right {
    background: #b82ffc;
    width: 400px;
    height: 400px;
    top: 200px;
    right: -150px;
}

@keyframes blobMove {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(40px, -30px) scale(1.1);
    }
}
/* === Changelog section badges ===
   Fixed order and colours: Added green, Changed blue, Fixed orange,
   Removed red, Security purple, Deprecated grey. */
.cl-badge {
    --cl: #8a8a94;
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    line-height: 1.4;
    text-transform: uppercase;
    color: var(--cl);
    background: color-mix(in srgb, var(--cl) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--cl) 45%, transparent);
}

.cl-added { --cl: #2ecc71; }
.cl-changed { --cl: #3ba7ff; }
.cl-fixed { --cl: #ffa64d; }
.cl-removed { --cl: #ff4d4d; }
.cl-security { --cl: #b06bff; }
.cl-deprecated { --cl: #8a8a94; }
.cl-other { --cl: var(--text-dim); }

/* Darker shades of the same hues keep the text readable on the light theme */
:root[data-theme="light"] .cl-added { --cl: #1a8f44; }
:root[data-theme="light"] .cl-changed { --cl: #0b6fc4; }
:root[data-theme="light"] .cl-fixed { --cl: #a96500; }
:root[data-theme="light"] .cl-removed { --cl: #d12f2f; }
:root[data-theme="light"] .cl-security { --cl: #7445d6; }
:root[data-theme="light"] .cl-deprecated { --cl: #5f5f6b; }

/* === /changelogs: Website and Discord Bot tabs ===
   Without JS (no .cl-js on <html>) every panel shows, one after another. */
.cl-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 20px 0 24px;
    border-bottom: 1px solid color-mix(in oklab, var(--muted) 70%, transparent);
}

.cl-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    margin-bottom: -1px;
    border-bottom: 2px solid transparent;
    color: var(--text-dim);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.cl-tab:hover { color: var(--text); }

.cl-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.cl-tab-version {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
}

.cl-js .cl-panel { display: none; }
.cl-js .cl-panel.active { display: block; }
.cl-js .cl-panel-title { display: none; }
.cl-panel:focus { outline: none; }
.cl-panel:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; }

.cl-entry {
    padding: 22px;
    margin-bottom: 16px;
}

.cl-entry-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
}

.section.prose .cl-entry-head h3 { margin: 0; font-size: 1.3rem; }

.cl-entry-head time {
    margin-left: auto;
    color: var(--text-dim);
    font-size: 14px;
}

.cl-latest {
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.cl-note { margin: 12px 0 0; }
.cl-entry h4 { margin: 18px 0 8px; }
.cl-entry ul { margin: 0; padding-left: 20px; }
.cl-entry li { margin: 0 0 6px; overflow-wrap: anywhere; }

@media (max-width: 560px) {
    .cl-tabs { gap: 0; }
    .cl-tab { padding: 10px 7px; gap: 6px; font-size: 15px; }
    .cl-tab-version { font-size: 11px; }
    .cl-entry { padding: 16px; }
    .cl-entry-head time { margin-left: 0; width: 100%; }
}

/* Created-with icons: optical sizing so the heart is not bigger than code and coffee */
.footer .copyright .fa-heart { font-size: .85em; vertical-align: -.125em; }
.footer .copyright .fa-code { font-size: 1em; vertical-align: -.125em; }
.footer .copyright .fa-coffee { font-size: .95em; vertical-align: -.125em; }
