/*
 * Headra marketing site: brand layer on top of Bootstrap 5.3 (dark colour mode).
 * Layout, spacing and grid come from Bootstrap utilities in the HTML; this file only holds the brand
 * colours, the gradient treatments and a few components Bootstrap doesn't have.
 */

/* ---- Font: Montserrat (variable weight, self-hosted, SIL Open Font Licence) ---------------------------- */
@font-face {
    font-family: "Montserrat";
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("../vendor/montserrat/montserrat-latin-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Montserrat";
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("../vendor/montserrat/montserrat-latin-ext-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Montserrat";
    font-style: italic;
    font-display: swap;
    font-weight: 100 900;
    src: url("../vendor/montserrat/montserrat-latin-wght-italic.woff2") format("woff2-variations");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- Brand tokens (from the logo) ---------------------------------------------------------------- */
:root,
[data-bs-theme="dark"] {
    --headra-purple: #9d4edd;
    --headra-blue: #2563eb;
    --headra-teal: #06b6d4;
    --headra-navy: #0b0f19;
    --headra-surface: #111827;
    --headra-surface-2: #172033;
    --headra-gradient: linear-gradient(120deg, var(--headra-purple) 0%, var(--headra-blue) 50%, var(--headra-teal) 100%);

    /* Bootstrap variables mapped to the brand */
    --bs-body-bg: var(--headra-navy);
    --bs-body-bg-rgb: 11, 15, 25;
    --bs-body-color: #c7d0dd;
    --bs-body-font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bs-emphasis-color: #f8fafc;
    --bs-secondary-color: #94a3b8;
    --bs-tertiary-bg: var(--headra-surface);
    --bs-secondary-bg: var(--headra-surface-2);
    --bs-border-color: rgba(148, 163, 184, 0.16);
    --bs-border-color-translucent: rgba(148, 163, 184, 0.12);
    --bs-primary: var(--headra-blue);
    --bs-primary-rgb: 37, 99, 235;
    --bs-info: var(--headra-teal);
    --bs-info-rgb: 6, 182, 212;
    --bs-link-color: #60a5fa;
    --bs-link-color-rgb: 96, 165, 250;
    --bs-link-hover-color: #93c5fd;
    --bs-link-hover-color-rgb: 147, 197, 253;
    --bs-heading-color: #f8fafc;
    --bs-code-color: #67e8f9;
    --bs-card-bg: var(--headra-surface);
}

body {
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: rgba(37, 99, 235, 0.45);
}

/* ---- Navbar --------------------------------------------------------------------------------------- */
.navbar-headra {
    background: rgba(11, 15, 25, 0.82);
    backdrop-filter: saturate(160%) blur(12px);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--bs-border-color-translucent);
}

.navbar-headra .nav-link {
    color: #cbd5e1;
}

.navbar-headra .nav-link:hover,
.navbar-headra .nav-link.active {
    color: #fff;
}

.brand-mark {
    width: 2.25rem;
    height: auto;
}

/* ---- Gradient treatments -------------------------------------------------------------------------- */
.text-gradient {
    background: var(--headra-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.btn-gradient {
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-color: #fff;
    --bs-btn-border-width: 0;
    background: var(--headra-gradient);
    background-size: 160% 100%;
    background-position: 0 0;
    box-shadow: 0 0.5rem 1.5rem rgba(37, 99, 235, 0.35);
    transition: background-position 0.3s ease, box-shadow 0.3s ease, transform 0.15s ease;
}

.btn-gradient:hover,
.btn-gradient:focus-visible {
    background-position: 100% 0;
    box-shadow: 0 0.75rem 2rem rgba(6, 182, 212, 0.35);
    transform: translateY(-1px);
}

.btn-outline-light {
    --bs-btn-border-color: rgba(248, 250, 252, 0.28);
}

/* Soft brand glow behind hero sections. */
.hero-glow {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

.hero-glow::before {
    content: "";
    position: absolute;
    inset: -20% -10% auto;
    height: 120%;
    z-index: -1;
    background:
        radial-gradient(40% 50% at 20% 30%, rgba(157, 78, 221, 0.28), transparent 70%),
        radial-gradient(40% 50% at 80% 20%, rgba(6, 182, 212, 0.22), transparent 70%),
        radial-gradient(50% 60% at 50% 80%, rgba(37, 99, 235, 0.22), transparent 70%);
    pointer-events: none;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.9rem;
    border: 1px solid rgba(96, 165, 250, 0.35);
    border-radius: 50rem;
    background: rgba(37, 99, 235, 0.12);
    color: #bfdbfe;
    font-size: 0.875rem;
    font-weight: 500;
}

/* ---- Cards and icons ------------------------------------------------------------------------------ */
.card-headra {
    --bs-card-bg: var(--headra-surface);
    --bs-card-border-color: var(--bs-border-color);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card-headra:hover {
    transform: translateY(-3px);
    border-color: rgba(96, 165, 250, 0.4);
    box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.35);
}

.icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.875rem;
    background: var(--headra-gradient);
    color: #fff;
    font-size: 1.35rem;
    box-shadow: 0 0.5rem 1.25rem rgba(37, 99, 235, 0.3);
}

.icon-badge-sm {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.625rem;
    font-size: 1rem;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: 2px solid transparent;
    background:
        linear-gradient(var(--headra-surface), var(--headra-surface)) padding-box,
        var(--headra-gradient) border-box;
    color: #fff;
    font-weight: 700;
}

.check-list {
    list-style: none;
    padding-left: 0;
}

.check-list li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 0.6rem;
}

.check-list li::before {
    content: "\F633"; /* Bootstrap Icons: check-lg */
    font-family: "bootstrap-icons";
    position: absolute;
    left: 0;
    top: 0.05rem;
    color: var(--headra-teal);
}

/* ---- Code windows ---------------------------------------------------------------------------------- */
.code-window {
    background: #0d1324;
    border: 1px solid var(--bs-border-color);
    border-radius: 1rem;
    box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.code-window-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.7rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--bs-border-color-translucent);
    color: var(--bs-secondary-color);
    font-size: 0.8rem;
}

.code-window-bar .dot {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background: #334155;
}

.code-window pre {
    margin: 0;
    padding: 1.25rem;
    color: #e2e8f0;
    font-size: 0.85rem;
    line-height: 1.7;
}

.code-window code {
    color: inherit;
}

/* Minimal hand-applied syntax colours. */
.tok-tag { color: #f472b6; }
.tok-attr { color: #a5b4fc; }
.tok-str { color: #67e8f9; }
.tok-key { color: #c084fc; }
.tok-fn { color: #60a5fa; }
.tok-com { color: #64748b; }

/* ---- Sections -------------------------------------------------------------------------------------- */
.section-alt {
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.6), rgba(17, 24, 39, 0.2));
    border-top: 1px solid var(--bs-border-color-translucent);
    border-bottom: 1px solid var(--bs-border-color-translucent);
}

.cta-panel {
    background:
        radial-gradient(60% 120% at 0% 0%, rgba(157, 78, 221, 0.35), transparent 60%),
        radial-gradient(60% 120% at 100% 100%, rgba(6, 182, 212, 0.3), transparent 60%),
        var(--headra-surface);
    border: 1px solid rgba(96, 165, 250, 0.25);
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 50rem;
    background: var(--headra-surface);
    color: #e2e8f0;
    font-size: 0.9rem;
}

/* Pricing: the highlighted plan. */
.plan-featured {
    border: 2px solid transparent;
    background:
        linear-gradient(var(--headra-surface), var(--headra-surface)) padding-box,
        var(--headra-gradient) border-box;
}

/* Features page: sticky in-page navigation on large screens. */
.feature-nav {
    top: 6rem;
}

.feature-nav .nav-link {
    color: var(--bs-secondary-color);
    border-left: 2px solid var(--bs-border-color);
    border-radius: 0;
}

.feature-nav .nav-link:hover {
    color: #fff;
    border-left-color: var(--headra-teal);
}

[id] {
    scroll-margin-top: 6rem;
}

.footer-headra {
    border-top: 1px solid var(--bs-border-color-translucent);
}

.footer-headra a {
    color: var(--bs-secondary-color);
    text-decoration: none;
}

.footer-headra a:hover {
    color: #fff;
}

@media (prefers-reduced-motion: reduce) {
    .btn-gradient,
    .card-headra {
        transition: none;
    }

    .btn-gradient:hover,
    .card-headra:hover {
        transform: none;
    }
}

/* ---- Docs (docs/*.html, generated from the admin help by `bin/headra docs:build`) ------------------ */
.docs-card {
    color: inherit;
}

.docs-toc {
    position: sticky;
    top: 6.5rem;
}

.docs-toc .nav-link {
    color: var(--bs-secondary-color);
}

.docs-toc .nav-link:hover,
.docs-toc .nav-link.active {
    color: var(--bs-emphasis-color);
}

.docs-body {
    max-width: 52rem;
}

.docs-body h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.docs-body h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 1.75rem;
}

.docs-body li + li {
    margin-top: 0.35rem;
}

.docs-body pre {
    background: #0d1324;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    color: #e2e8f0;
    font-size: 0.85rem;
    line-height: 1.7;
}

.docs-body pre code {
    color: inherit;
}

.docs-body .table {
    --bs-table-bg: transparent;
    font-size: 0.95rem;
}

.docs-body .lead {
    color: var(--bs-secondary-color);
}

/* ---- Theme switcher (docs only; the same light/dark/auto dropdown as the app) ----------------------- */
.btn-navbar {
    --bs-btn-color: #cbd5e1;
    --bs-btn-border-color: rgba(248, 250, 252, 0.22);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: rgba(248, 250, 252, 0.08);
    --bs-btn-hover-border-color: rgba(248, 250, 252, 0.35);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: rgba(248, 250, 252, 0.12);
    --bs-btn-active-border-color: rgba(248, 250, 252, 0.35);
}

.theme-icon {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
    flex-shrink: 0;
}

.theme-switcher .dropdown-toggle::after {
    display: none;
}

.theme-switcher .dropdown-menu {
    --bs-dropdown-min-width: 9rem;
    --bs-dropdown-font-size: 0.875rem;
}

.theme-switcher .dropdown-item.active,
.theme-switcher .dropdown-item:active {
    color: var(--bs-dropdown-link-hover-color);
    background-color: transparent;
}

.theme-switcher .theme-check {
    visibility: hidden;
}

.theme-switcher .dropdown-item.active .theme-check {
    visibility: visible;
}

/* ---- Light theme (docs only: the other pages are always dark). The navbar keeps data-bs-theme="dark". */
[data-bs-theme="light"] {
    --headra-surface: #ffffff;
    --headra-surface-2: #eef1f7;
    --bs-body-bg: #f5f7fb;
    --bs-body-bg-rgb: 245, 247, 251;
    --bs-body-color: #334155;
    --bs-emphasis-color: #0b0f19;
    --bs-secondary-color: #64748b;
    --bs-tertiary-bg: #ffffff;
    --bs-secondary-bg: #eef1f7;
    --bs-border-color: rgba(15, 23, 42, 0.12);
    --bs-border-color-translucent: rgba(15, 23, 42, 0.08);
    --bs-link-color: #1d4ed8;
    --bs-link-color-rgb: 29, 78, 216;
    --bs-link-hover-color: #7c3aed;
    --bs-link-hover-color-rgb: 124, 58, 237;
    --bs-heading-color: #0b0f19;
    --bs-code-color: #0e7490;
    --bs-card-bg: #ffffff;
}

/* Navy in both themes, like the app's top bar: the translucent dark bar turns grey over a light page. */
[data-bs-theme="light"] .navbar-headra {
    background: rgba(11, 15, 25, 0.96);
}

[data-bs-theme="light"] .eyebrow {
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.08);
}

[data-bs-theme="light"] .card-headra:hover {
    border-color: rgba(37, 99, 235, 0.35);
    box-shadow: 0 1rem 2rem rgba(15, 23, 42, 0.1);
}

[data-bs-theme="light"] .footer-headra a:hover {
    color: var(--bs-emphasis-color);
}

[data-bs-theme="light"] ::selection {
    background: rgba(37, 99, 235, 0.2);
}
