/* assets/css/style.css */

/* ----------------------------- */
/* base + tokens */
/* ----------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

html { font-size: 100%; }

:root {
    --bg: #ffffff;
    --text: #0f1115;
    --muted: rgba(15, 17, 21, 0.65);

    --panel: #f2f2f2;
    --panel-2: #f7f7f7;

    --border: rgba(15, 17, 21, 0.16);
    --border-2: rgba(15, 17, 21, 0.10);

    --accent: #449cf8;
    --accent-2: rgba(68, 156, 248, 0.12);

    --shadow: rgba(0, 0, 0, 0.08);

    --radius: 0.5rem;
    --radius-lg: 0.75rem;

    --container: 67.5rem;
    --gutter: 1.25rem;

    --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system,
        "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        "Liberation Mono", "Courier New", monospace;

    --lh: 1.6;
}

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

img { max-width: 100%; height: auto; display: block; }

a {
    color: var(--accent);
    text-decoration: none;

    &:hover { text-decoration: underline; }
}

video {
  width: 100%;
  height: auto;
  display: block;
  max-width: 600px;
}

pre,
code {
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    line-height: 1.55;
}

pre { margin: 0; }

.mono { font-family: var(--font-mono); }

h1, h2, h3 { letter-spacing: -0.02em; }

/* ----------------------------- */
/* layout helpers */
/* ----------------------------- */

.container {
    width: 100%;
    max-width: var(--container);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
}

.section {
    padding-top: 4rem;
    padding-bottom: 4rem;

    &.alt {
        background: var(--panel-2);
        border-top: 0.0625rem solid var(--border-2);
        border-bottom: 0.0625rem solid var(--border-2);
    }
}

.section-head {
    text-align: center;
    margin-bottom: 2.25rem;

    .section-title {
        font-size: 2rem;
        line-height: 1.2;
        letter-spacing: -0.02em;
        margin: 0 0 1rem 0;
    }

    .section-subtitle {
        margin: 0 auto;
        max-width: 48rem;
        color: var(--muted);
        font-size: 1.0625rem;
        line-height: 1.7;
    }
}

.two-col {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: start;

    @media (min-width: 48rem) {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
}

/* ----------------------------- */
/* topbar -- shared */
/* ----------------------------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(0.75rem);
    border-bottom: 0.0625rem solid var(--border-2);
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding-top: 1rem;
    padding-bottom: 1rem;

    .left {
        display: flex;
        gap: 1rem;

        .brand-logo { width: 7rem; }

        .brand-name {
            font-weight: 700;
            letter-spacing: -0.02em;
            font-size: 2rem;
            margin: 0;
        }

        .tagline { margin: 0 0 1rem 0; }
    }
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text);
    text-decoration: none;

    &:hover { text-decoration: none; }
}

.nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;

    @media (max-width: 34rem) { display: none; }
}

.nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    color: rgba(15, 17, 21, 0.82);
    border-radius: 0.5rem;

    &:hover {
        text-decoration: none;
        background: var(--panel);
        color: var(--text);
    }

    &.is-active {
        background: var(--accent-2);
        color: var(--text);
    }
}

/* ----------------------------- */
/* buttons -- shared */
/* ----------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;

    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;

    padding: 0.75rem 1.1rem;
    border-radius: 0.5rem;

    border: 0.0625rem solid rgba(68, 156, 248, 0.7);
    color: var(--accent);
    background: transparent;

    transition: transform 120ms ease, background 120ms ease, opacity 120ms ease;

    &:hover {
        text-decoration: none;
        background: var(--accent-2);
        transform: translateY(-0.0625rem);
    }

    &:active { transform: translateY(0); opacity: 0.85; }

    &.primary {
        background: var(--accent);
        color: #ffffff;
        border-color: var(--accent);

        &:hover { background: #2f88ea; }
    }
}

/* ----------------------------- */
/* code card -- shared */
/* ----------------------------- */

.code-card {
    border-radius: var(--radius-lg);
    border: 0.0625rem solid var(--border);
    background: var(--panel-2);
    box-shadow: 0 0.75rem 2rem var(--shadow);
    overflow: hidden;

    .code-card-head {
        padding: 1rem 1.25rem;
        border-bottom: 0.0625rem solid var(--border-2);
        background: rgba(255, 255, 255, 0.6);

        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 1rem;

        .code-card-title {
            font-weight: 700;
            letter-spacing: -0.02em;
        }

        .code-card-hint {
            color: var(--muted);
            font-size: 0.9375rem;
        }
    }

    .code {
        padding: 1.1rem 1.25rem;
        background: var(--panel);
        overflow: auto;

        code {
            display: block;
            white-space: pre;
        }
    }

    .code-card-foot {
        padding: 0.85rem 1.25rem;
        border-top: 0.0625rem solid var(--border-2);
        color: var(--muted);
        font-size: 0.9375rem;
    }
}

/* ----------------------------- */
/* band -- shared */
/* ----------------------------- */

.band {
    background: var(--panel);
    border-top: 0.0625rem solid var(--border-2);
    border-bottom: 0.0625rem solid var(--border-2);

    .band-inner {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.9rem;
        padding-top: 1rem;
        padding-bottom: 1rem;
        color: rgba(15, 17, 21, 0.78);
    }

    .band-item { font-weight: 600; font-size: 0.975rem; }

    .band-dot {
        width: 0.375rem;
        height: 0.375rem;
        border-radius: 999rem;
        background: rgba(15, 17, 21, 0.25);
    }
}

/* ----------------------------- */
/* steps -- shared */
/* ----------------------------- */

.steps {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    max-width: 54rem;
    margin-left: auto;
    margin-right: auto;

    .step {
        display: flex;
        gap: 1rem;
        padding: 1rem 1.1rem;
        border: 0.0625rem solid var(--border-2);
        border-radius: var(--radius);
        background: #ffffff;

        .step-num {
            flex: 0 0 auto;
            width: 2.25rem;
            height: 2.25rem;
            border-radius: 999rem;
            background: var(--accent-2);
            color: var(--accent);

            display: grid;
            place-items: center;

            font-weight: 800;
        }

        .step-title {
            font-weight: 700;
            letter-spacing: -0.01em;
            margin-bottom: 0.25rem;
        }

        .step-text { color: var(--muted); }
    }
}

/* ----------------------------- */
/* media -- shared */
/* ----------------------------- */

.media-card {
    border-radius: var(--radius-lg);
    border: 0.0625rem solid var(--border);
    background: #ffffff;
    overflow: hidden;
    box-shadow: 0 0.75rem 2rem var(--shadow);

    .media-title {
        padding: 1rem 1.25rem 0 1.25rem;
        font-weight: 700;
    }

    .media-subtitle {
        padding: 0.25rem 1.25rem 1rem 1.25rem;
        color: var(--muted);
        font-size: 0.9375rem;
    }

    .video { width: 100%; height: auto; display: block; }
}

/* ----------------------------- */
/* callout -- shared */
/* ----------------------------- */

.callout {
    margin-top: 1rem;
    padding: 1rem 1.1rem;
    background: var(--accent-2);
    border: 0.0625rem solid rgba(68, 156, 248, 0.25);
    border-radius: var(--radius);
    color: rgba(15, 17, 21, 0.85);

    .mono { font-size: 0.95em; }
}

/* ----------------------------- */
/* footer -- shared */
/* ----------------------------- */

.footer {
    background: #222226;
    color: rgba(255, 255, 255, 0.92);
    padding-top: 4rem;
    padding-bottom: 2rem;

    .footer-inner {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 2rem;
        flex-wrap: wrap;
        padding-bottom: 2.5rem;
        border-bottom: 0.0625rem solid rgba(255, 255, 255, 0.12);
    }

    .footer-left {
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    .footer-logo { width: 2.25rem; height: 2.25rem; }

    .footer-name { font-weight: 800; letter-spacing: -0.02em; }
    .footer-tagline { color: rgba(255, 255, 255, 0.72); }

    .footer-right {
        display: flex;
        align-items: center;
        gap: 1rem;
        flex-wrap: wrap;
    }

    .footer-link {
        color: rgba(255, 255, 255, 0.84);
        padding: 0.25rem 0.5rem;
        border-radius: 0.5rem;

        &:hover {
            text-decoration: none;
            background: rgba(255, 255, 255, 0.08);
            color: #ffffff;
        }
    }

    .footer-bottom {
        padding-top: 1.5rem;
        color: rgba(255, 255, 255, 0.72);
        font-size: 0.9375rem;
        text-align: center;
    }
}

/* ----------------------------- */
/* home-only */
/* ----------------------------- */

body.home {
    .hero {
        padding-top: 4.5rem;
        padding-bottom: 3.5rem;
    }

    .hero-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 2.25rem;
        align-items: start;

        @media (min-width: 56rem) {
            grid-template-columns: 1.15fr 0.85fr;
            gap: 3rem;
        }
    }

    .hero-title {
        margin: 0 0 1.25rem 0;
        font-size: 1.3rem;
        line-height: 1.12;
        letter-spacing: -0.03em;
    }

    @media (max-width: 30rem) {
        .hero-title { font-size: 2.125rem; }
    }

    .hero-subtitle {
        margin: 0 0 1.75rem 0;
        max-width: 42rem;
        color: var(--muted);
        font-size: 1.125rem;
        line-height: 1.75;
    }

    .hero-ctas {
        display: flex;
        gap: 0.75rem;
        flex-wrap: wrap;
        margin-bottom: 1.75rem;
    }

    .trust-strip {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.75rem;
        margin-top: 1.25rem;

        @media (min-width: 40rem) {
            grid-template-columns: repeat(3, 1fr);
        }
    }

    .trust-item {
        background: var(--panel);
        border: 0.0625rem solid var(--border-2);
        border-radius: var(--radius);
        padding: 1rem;
    }

    .trust-value {
        font-weight: 800;
        letter-spacing: -0.02em;
        font-size: 1.125rem;
        margin-bottom: 0.25rem;
    }

    .trust-label {
        color: var(--muted);
        font-size: 0.9375rem;
    }

    .bottom-cta {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1.5rem;
        flex-wrap: wrap;

        padding: 1.5rem;
        border-radius: var(--radius-lg);
        background: var(--panel);
        border: 0.0625rem solid var(--border-2);
    }

    .bottom-cta-title {
        margin: 0 0 0.5rem 0;
        font-size: 2rem;
        line-height: 1.2;
        letter-spacing: -0.02em;
    }

    .bottom-cta-subtitle {
        margin: 0;
        color: var(--muted);
        font-size: 1.0625rem;
    }

    .bottom-cta-actions {
        display: flex;
        gap: 0.75rem;
        flex-wrap: wrap;
    }

    @media (max-width: 30rem) {
        .hero { padding-top: 3.5rem; }
        .hero-ctas { margin-bottom: 1.25rem; }
        .bottom-cta { padding: 1.25rem; }
    }


    .how-it-fits {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas:
            "text video"
            "bottom bottom";
        gap: 3rem;
        align-items: start;

        /* IMPORTANT: make children stretch by default */
        justify-items: stretch;
        width: 100%;
    }

    /* grid areas */
    .how-it-fits .text {
        grid-area: text;
    }

    .how-it-fits .demo-video {
        grid-area: video;
        width: 100%;
        border-radius: 0.75rem;
    }

    /* steps base */
    .how-it-fits .steps {
        display: flex;
        flex-direction: column;
        gap: 1.25rem;

        /* kill common centering constraints */
        width: 100%;
        max-width: none;
        margin: 0;
    }

    /* bottom steps: span exactly from left column start to right column end */
    .how-it-fits .steps.bottom-steps {
        grid-area: bottom;

        /* force spanning both columns even if grid-area gets messed with */
        grid-column: 1 / -1;

        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2rem;

        /* THIS is the anti-centering part */
        width: 100%;
        max-width: none;
        margin: 0;
        justify-self: stretch;
        align-self: stretch;
    }

    /* step layout */
    .how-it-fits .step {
        display: flex;
        gap: 1rem;
        align-items: flex-start;
        min-width: 0;
        width: 100%;
    }

    /* number bubble */
    .how-it-fits .step-num {
        font-weight: 600;
        font-size: 1.1rem;
        width: 2rem;
        height: 2rem;
        border-radius: 999px;
        background: #2563eb;
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    /* mobile fallback */
    @media (max-width: 768px) {
        .how-it-fits {
            grid-template-columns: 1fr;
            grid-template-areas:
                "text"
                "video"
                "bottom";
        }

        .how-it-fits .steps.bottom-steps {
            grid-template-columns: 1fr;
        }
    }

}

/* ----------------------------- */
/* page-specific overrides */
/* ----------------------------- */

#reverse-proxy .two-col {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

#reverse-proxy .two-col > * {
    min-width: 0;
}

/* ----------------------------- */
/* docs page */
/* ----------------------------- */

body.docs {

    section { margin-bottom: 2rem; }

    .docs-hero {
        padding-top: 3rem;
        padding-bottom: 2rem;
    }

    .docs-hero-inner {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        gap: 1.5rem;
        flex-wrap: wrap;
    }

    .docs-title {
        margin: 0 0 0.5rem 0;
        font-size: 2.25rem;
        line-height: 1.15;
        letter-spacing: -0.02em;
    }

    .docs-subtitle {
        margin: 0;
        color: var(--muted);
        font-size: 1.0625rem;
        line-height: 1.7;
        max-width: 52rem;
    }

    .docs-hero-cta {
        display: flex;
        gap: 0.75rem;
        flex-wrap: wrap;
    }

    .docs-layout {
        display: grid;
        grid-template-columns: 1fr;
        gap: 2rem;
        align-items: start;
    }

    @media (min-width: 56rem) {
        .docs-layout {
            grid-template-columns: 16rem 1fr;
            gap: 3rem;
        }

        .docs-aside {
            position: sticky;
            top: 6rem;
            align-self: start;
        }
    }

    .docs-aside-title {
        font-weight: 800;
        letter-spacing: -0.02em;
        margin-bottom: 0.75rem;
    }

    .docs-toc {
        display: flex;
        flex-direction: column;
        gap: 0.375rem;

        a {
            color: rgba(15, 17, 21, 0.78);
            padding: 0.4rem 0.6rem;
            border-radius: 0.5rem;

            &:hover {
                text-decoration: none;
                background: var(--panel);
                color: var(--text);
            }

            &.active {
                background: var(--accent-2);
                color: var(--accent);
                font-weight: 600;
            }
        }
    }

    .docs-section {
        padding-top: 0.25rem;
        scroll-margin-top: 10rem;
    }

    .docs-h2 {
        margin: 0 0 1rem 0;
        font-size: 1.5rem;
        line-height: 1.25;
        letter-spacing: -0.02em;
    }

    .docs-p {
        margin: 0 0 1rem 0;
        color: rgba(15, 17, 21, 0.88);
    }

    .docs-links {
        margin: 0;
        padding-left: 1.25rem;

        li { margin-bottom: 0.4rem; }
    }

    .docs-split {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    @media (min-width: 48rem) {
        .docs-split { grid-template-columns: 1fr 1fr; }
    }

    .docs-block { margin-top: 1.5rem; }

    /* Reusable info card used throughout docs */
    .info-card {

        margin: 1rem 0;

        .info-title {
            font-weight: 800;
            letter-spacing: -0.02em;
            margin-bottom: 0.5rem;
        }

        .info-text {
            margin: 0 0 1rem 0;
            color: var(--muted);
        }

        .info-list {
            margin: 0;
            padding-left: 1.25rem;

            li { margin-bottom: 0.5rem; }
        }
    }

    .code-card {
        margin-bottom: 0.5rem;
    }

    /* Make reverse proxy block truly 50/50 on wide screens */
    .docs-two-col {
        display: grid;
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    @media (min-width: 48rem) {
        .docs-two-col { grid-template-columns: 1fr 1fr; gap: 3rem; }
    }
}


/* ----------------------------- */
/* downloads page */
/* ----------------------------- */
body.downloads {
    .downloads-hero {
        padding-top: 3rem;
        padding-bottom: 2rem;
    }

    .downloads-hero-inner {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        gap: 1.5rem;
        flex-wrap: wrap;
    }

    .downloads-title {
        margin: 0 0 0.5rem 0;
        font-size: 2.25rem;
        line-height: 1.15;
        letter-spacing: -0.02em;
    }

    .downloads-subtitle {
        margin: 0;
        color: var(--muted);
        font-size: 1.0625rem;
        line-height: 1.7;
        max-width: 52rem;
    }

    .downloads-meta {
        margin-top: 1rem;
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .downloads-pill {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0.35rem 0.6rem;
        border-radius: 999rem;
        background: var(--accent-2);
        border: 0.0625rem solid rgba(68, 156, 248, 0.22);
        color: rgba(15, 17, 21, 0.82);
        font-weight: 700;
        font-size: 0.875rem;
    }

    .downloads-hero-cta {
        display: flex;
        gap: 0.75rem;
        flex-wrap: wrap;
    }

    .downloads-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    @media (min-width: 56rem) {
        .downloads-grid { grid-template-columns: repeat(3, 1fr); }
    }

    .download-card {
        border-radius: var(--radius-lg);
        border: 0.0625rem solid var(--border);
        background: #ffffff;
        box-shadow: 0 0.75rem 2rem var(--shadow);
        overflow: hidden;
    }

    .download-card-head {
        padding: 1rem 1.25rem;
        border-bottom: 0.0625rem solid var(--border-2);
        background: rgba(255, 255, 255, 0.6);

        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 1rem;
    }

    .download-card-title {
        font-weight: 800;
        letter-spacing: -0.02em;
    }

    .download-card-hint {
        color: var(--muted);
        font-size: 0.9375rem;
    }

    .download-rows {
        display: flex;
        flex-direction: column;
    }

    .download-row {
        display: flex;
        align-items: center;
        gap: 0.9rem;

        padding: 0.9rem 1.25rem;
        border-top: 0.0625rem solid var(--border-2);

        color: var(--text);
        text-decoration: none;

        &:hover {
            text-decoration: none;
            background: var(--panel-2);
        }
    }

    .download-row:first-child { border-top: 0; }

    .pkg-icon {
        width: 1.5rem;
        height: 1.5rem;
        flex: 0 0 auto;
        opacity: 0.9;
    }

    .download-row-main {
        min-width: 0;
        flex: 1;
    }

    .download-row-name {
        font-weight: 700;
        letter-spacing: -0.01em;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .download-row-meta {
        color: var(--muted);
        font-size: 0.9375rem;
        margin-top: 0.15rem;
    }

    .download-row-sha {
        font-family: var(--font-mono);
        font-size: 0.6875rem;
        color: var(--muted);
        margin-top: 0.5rem;
        word-break: break-all;
        line-height: 1.4;
        opacity: 0.8;
    }

    .download-row-cta {
        flex: 0 0 auto;
        font-weight: 700;
        color: var(--accent);
    }

    /* Keep "two-col" sections truly 50/50 on this page */
    .downloads-two-col {
        display: grid;
        grid-template-columns: 1fr;
        gap: 2rem;
        align-items: start;
    }

    @media (min-width: 48rem) {
        .downloads-two-col {
            grid-template-columns: 1fr 1fr;
            gap: 3rem;
        }
    }
}


/* ----------------------------- */
/* contact page */
/* ----------------------------- */

body.contact {
    .contact-hero {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }

    .contact-title {
        margin-bottom: 0.75rem;
    }

    .contact-two-col {
        margin-top: 2rem;
    }

    .contact-block {
        margin-top: 1.25rem;
        padding: 1rem 1.1rem;
        border-radius: var(--radius);
        background: var(--panel);
        border: 0.0625rem solid var(--border-2);
    }

    .contact-label {
        font-weight: 800;
        letter-spacing: -0.01em;
        margin-bottom: 0.25rem;
    }

    .contact-email {
        display: inline-block;
        font-weight: 700;
        font-size: 1.0625rem;
        text-decoration: none;

        &:hover { text-decoration: underline; }
    }

    .contact-hint {
        margin-top: 0.25rem;
        color: var(--muted);
        font-size: 0.9375rem;
    }

    /* Keep contact page two-col as grid 50/50 (avoid any global flex overrides) */
    .contact-two-col {
        display: grid;
        grid-template-columns: 1fr;
        gap: 2rem;
        align-items: start;
    }

    @media (min-width: 48rem) {
        .contact-two-col {
            grid-template-columns: 1fr 1fr;
            gap: 3rem;
        }
    }
}

