/*
 * Highver brand layer for every public page except the homepage (which carries the same
 * look inline). Loaded after Tailwind, so it sets the shared header and footer, the night
 * backdrop, Rubik, and remaps the few old helper classes (.gradient-text, blog heroes).
 * Colors match index.html: primary #3b5bfd, teal #2ee6c5, violet #9b6bff.
 */
:root {
    --hv-bg: #05070f;
    --hv-ink: #f4f6ff;
    --hv-ink-2: #b9c1dc;
    --hv-ink-3: #7d87a8;
    --hv-line: rgba(148, 163, 255, .14);
    --hv-primary: #3b5bfd;
    --hv-primary-2: #6d83ff;
    --hv-teal: #2ee6c5;
    --hv-violet: #9b6bff;
}

html { -webkit-text-size-adjust: 100%; }
body.hv-brand {
    background:
        radial-gradient(55% 45% at 85% 0%, rgba(59, 91, 253, .22), transparent 70%),
        radial-gradient(40% 40% at 0% 30%, rgba(155, 107, 255, .10), transparent 70%),
        radial-gradient(45% 40% at 10% 100%, rgba(46, 230, 197, .07), transparent 70%),
        var(--hv-bg) !important;
    background-attachment: fixed !important;
    color: var(--hv-ink);
    overflow-x: hidden;
}
body.hv-brand, body.hv-brand *:not([class*="material-symbols"]) {
    font-family: 'Rubik', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif !important;
}
body.hv-brand :focus-visible { outline: 3px solid var(--hv-teal); outline-offset: 3px; }

/* Old helper classes, now in the new palette */
body.hv-brand .gradient-text {
    background: linear-gradient(100deg, #8ea0ff 0%, #3b5bfd 40%, #2ee6c5 80%, #9b6bff 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}
body.hv-brand h1, body.hv-brand h2 { letter-spacing: -.01em; }

/* Cards on the dark pages get the brand's blue-tinted glass instead of flat slate */
body.hv-brand .bg-slate-900\/50, body.hv-brand .bg-slate-900\/60, body.hv-brand .bg-slate-900\/70 {
    background-color: rgba(13, 19, 40, .66) !important;
}
body.hv-brand .border-slate-800 { border-color: var(--hv-line) !important; }
body.hv-brand .dark\:bg-slate-900:where(.dark *) { background-color: rgba(13, 19, 40, .78) !important; }
body.hv-brand .dark\:bg-slate-950:where(.dark *) { background-color: transparent !important; }
body.hv-brand .dark\:bg-slate-800:where(.dark *) { background-color: rgba(22, 30, 62, .7) !important; }
body.hv-brand .dark\:border-slate-800:where(.dark *) { border-color: var(--hv-line) !important; }

/* Blog article hero: one brand look instead of a different loud gradient per article */
body.hv-brand .blog-hero {
    position: relative; overflow: hidden;
    background:
        radial-gradient(60% 90% at 85% 0%, rgba(59, 91, 253, .38), transparent 70%),
        radial-gradient(50% 80% at 5% 100%, rgba(46, 230, 197, .14), transparent 70%),
        linear-gradient(160deg, #0d1430, #070a18) !important;
    border-bottom: 1px solid var(--hv-line);
}
body.hv-brand .blog-hero::before {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35;
    background-image: linear-gradient(rgba(140, 160, 255, .12) 1px, transparent 1px), linear-gradient(90deg, rgba(140, 160, 255, .12) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(70% 90% at 70% 10%, #000, transparent 75%);
    mask-image: radial-gradient(70% 90% at 70% 10%, #000, transparent 75%);
}
body.hv-brand .blog-hero > * { position: relative; }
body.hv-brand .blog-hero h1 { font-weight: 900; }

/* Article text */
body.hv-brand .prose a { color: #8ea0ff; }
body.hv-brand .prose a:hover { color: #fff; }

/* ---------- shared header ---------- */
.hv-header {
    position: sticky; top: 0; z-index: 50;
    backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
    background: linear-gradient(to bottom, rgba(5, 7, 15, .82), rgba(5, 7, 15, .55));
    border-bottom: 1px solid var(--hv-line);
}
.hv-nav { max-width: 1200px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 24px; }
.hv-logo img { height: 34px; width: auto; display: block; }
.hv-links { display: flex; gap: 26px; margin-inline-start: 12px; }
.hv-links a { text-decoration: none; color: var(--hv-ink-2); font-weight: 500; font-size: 15px; transition: color .2s; }
.hv-links a:hover, .hv-links a[aria-current] { color: #fff; }
.hv-end { margin-inline-start: auto; display: flex; align-items: center; gap: 14px; }
.hv-end .hv-login { color: var(--hv-ink-2); text-decoration: none; font-size: 15px; }
.hv-end .hv-login:hover { color: #fff; }
.hv-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
    font-weight: 700; font-size: 15px; text-decoration: none; color: #fff; padding: 9px 16px; border-radius: 11px;
    background: linear-gradient(135deg, #4f6bff 0%, var(--hv-primary) 50%, #2a44d8 100%);
    box-shadow: 0 10px 30px -8px rgba(59, 91, 253, .7), inset 0 1px 0 rgba(255, 255, 255, .25);
    transition: transform .2s ease, box-shadow .3s ease;
}
.hv-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -8px rgba(59, 91, 253, .85), inset 0 1px 0 rgba(255, 255, 255, .25); }
.hv-menu-btn { display: none; background: none; border: 1px solid var(--hv-line); color: #fff; border-radius: 10px; width: 42px; height: 42px; cursor: pointer; place-items: center; }
.hv-menu-btn svg { width: 22px; height: 22px; }
.hv-mobile { display: none; }

/* ---------- shared footer ---------- */
.hv-footer { position: relative; border-top: 1px solid var(--hv-line); background: rgba(3, 5, 12, .88); padding: 46px 0; color: var(--hv-ink-3); }
.hv-foot { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.hv-foot img { height: 30px; width: auto; display: block; }
.hv-foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.hv-foot nav a { color: var(--hv-ink-2); text-decoration: none; font-size: 15px; }
.hv-foot nav a:hover { color: #fff; }
.hv-foot small { color: var(--hv-ink-3); font-size: 14px; }

@media (max-width: 900px) {
    .hv-links, .hv-end .hv-login { display: none; }
    .hv-menu-btn { display: grid; }
    .hv-mobile.open { display: grid; gap: 4px; border-top: 1px solid var(--hv-line); padding: 10px 20px 18px; }
    .hv-mobile a { padding: 12px 4px; text-decoration: none; color: var(--hv-ink); font-size: 17px; border-bottom: 1px solid rgba(255, 255, 255, .05); }
}
@media (max-width: 600px) {
    .hv-nav { padding: 12px 16px; gap: 12px; }
    .hv-logo img { height: 28px; }
}
@media (prefers-reduced-motion: reduce) {
    .hv-btn, .hv-btn:hover { transition: none; transform: none; }
}

/* Content that overlaps the hero with a negative margin (article table of contents) stays on top */
body.hv-brand .blog-hero ~ * { position: relative; z-index: 1; }

/* Form fields: the Tailwind forms plugin would otherwise paint them white with square corners */
body.hv-brand input.field, body.hv-brand textarea.field, body.hv-brand select.field {
    background-color: #0b1220 !important; color: #fff !important; border: 1px solid rgba(140, 160, 255, .22) !important;
    border-radius: 12px !important; padding: 13px 15px !important; box-shadow: none;
}
body.hv-brand input.field:focus, body.hv-brand textarea.field:focus { border-color: #6d83ff !important; box-shadow: 0 0 0 3px rgba(59, 91, 253, .25) !important; outline: none; }

/* Glass card used by the login screens */
body.hv-brand .hv-card {
    background: linear-gradient(160deg, rgba(16, 23, 50, .9), rgba(8, 12, 28, .92)) !important;
    border: 1px solid rgba(140, 160, 255, .2) !important;
    box-shadow: 0 40px 100px -40px rgba(0, 0, 0, .9), 0 30px 80px -50px rgba(59, 91, 253, .6) !important;
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}

/* Same text rendering as the homepage, so the shared header and footer look identical everywhere */
body.hv-brand, .hv-header, .hv-footer { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
.hv-footer { z-index: 2; }
.hv-header, .hv-footer { font-family: 'Rubik', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif; line-height: 1.6; }
.hv-header *, .hv-footer * { box-sizing: border-box; }
