:root {
    /* ===== Base colors (ONE source of truth) ===== */
    --bg0: #070a12;
    --bg1: #0b1020;
    /* Use RGB triplets so we can reuse them with different alpha */
    --text-rgb: 234 240 255;
    /* #eaf0ff */
    --white-rgb: 255 255 255;
    --black-rgb: 0 0 0;
    /* Accents */
    --accent1: #7c3aed;
    --accent2: #06b6d4;
    --accent3: #22c55e;
    /* ===== Semantic text colors (consolidated) ===== */
    --text: rgb(var(--text-rgb));
    --text-strong: rgba(var(--text-rgb) / 0.92);
    --text-soft: rgba(var(--text-rgb) / 0.78);
    --text-muted: rgba(var(--text-rgb) / 0.7);
    --text-faint: rgba(var(--text-rgb) / 0.52);
    --text-dim: rgba(var(--text-rgb) / 0.55);
    /* Lines */
    --line: rgba(var(--text-rgb) / 0.12);
    --line-weak: rgba(var(--text-rgb) / 0.1);
    --line-strong: rgba(var(--white-rgb) / 0.14);
    --line-stronger: rgba(var(--white-rgb) / 0.22);
    /* ===== Overlays (consolidated) ===== */
    --glass-1: rgba(var(--white-rgb) / 0.02);
    --glass-2: rgba(var(--white-rgb) / 0.03);
    --glass-3: rgba(var(--white-rgb) / 0.04);
    --glass-4: rgba(var(--white-rgb) / 0.06);
    --glass-5: rgba(var(--white-rgb) / 0.1);
    /* ===== Shadow alphas (consolidated) ===== */
    --shadow-1: rgba(var(--black-rgb) / 0.35);
    --shadow-2: rgba(var(--black-rgb) / 0.38);
    --shadow-3: rgba(var(--black-rgb) / 0.45);
    --shadow-4: rgba(var(--black-rgb) / 0.48);
    --shadow-hero: rgba(var(--black-rgb) / 0.55);
    /* Elevations */
    --elev-1: 0 10px 30px var(--shadow-1);
    --elev-2: 0 10px 28px var(--shadow-2);
    --elev-3: 0 14px 38px var(--shadow-3);
    --elev-4: 0 16px 50px var(--shadow-3);
    --elev-hero: 0 18px 60px var(--shadow-hero);
    /* Layout */
    --radius: 18px;
    --radius2: 26px;
    --max: 1120px;
    /* Focus */
    --focus: rgba(124, 58, 237, 0.65);
    /* Surface defaults */
    --surface-border: rgba(var(--white-rgb) / 0.12);
    --surface-border-strong: rgba(var(--white-rgb) / 0.14);
    --surface-bg-top: var(--glass-4);
    --surface-bg-bottom: rgba(var(--white-rgb) / 0.035);
    /* only “odd” value kept */
    --surface-shadow: var(--elev-1);
    --surface-shadow-hero: var(--elev-hero);
    /* Top bar */
    --topbar-h: 0px;
    /* will be set by JS */
}

/* ===== Base ===== */
* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
    scroll-padding-top: calc(var(--topbar-h) + 16px);
}

body {
    margin: 0;
    color: var(--text);
    background-color: var(--bg0);
    font-family:
        ui-sans-serif,
        system-ui,
        -apple-system,
        Segoe UI,
        Roboto,
        Helvetica,
        Arial,
        "Apple Color Emoji",
        "Segoe UI Emoji";
    line-height: 1.6;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(1200px 900px at 8% 10%, rgba(124, 58, 237, 0.2), transparent 55%),
        radial-gradient(1000px 800px at 92% 18%, rgba(6, 182, 212, 0.16), transparent 52%),
        radial-gradient(1200px 800px at 45% 105%, rgba(34, 197, 94, 0.1), transparent 55%),
        linear-gradient(180deg, var(--bg0), var(--bg1));
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Unified focus-visible */
:where(a, button, input, .anchor-link):focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
    border-radius: 6px;
}

.wrap {
    max-width: var(--max);
    margin: 0 auto;
    padding: 28px 18px 80px;
}

/* ===== Surface system ===== */
.surface {
    border-radius: var(--surface-radius, var(--radius));
    border: 1px solid var(--surface-border, rgba(var(--white-rgb) / 0.12));
    background: linear-gradient(180deg,
            var(--surface-bg-top, var(--glass-4)),
            var(--surface-bg-bottom, rgba(var(--white-rgb) / 0.035)));
    box-shadow: var(--surface-shadow, var(--elev-1));
    overflow: hidden;
}

.surface--lg {
    --surface-radius: var(--radius2);
}

.surface--hero {
    --surface-shadow: var(--surface-shadow-hero);
    --surface-border: var(--surface-border-strong);
    --surface-bg-top: rgba(var(--white-rgb) / 0.07);
    --surface-bg-bottom: var(--glass-3);
}

.surface--chooser {
    --surface-radius: var(--radius2);
    --surface-border: var(--surface-border-strong);
    --surface-bg-top: var(--glass-4);
    --surface-bg-bottom: rgba(var(--white-rgb) / 0.035);
}

.surface--inset {
    --surface-shadow: none;
    --surface-bg-top: var(--glass-2);
    --surface-bg-bottom: var(--glass-2);
    --surface-radius: 16px;
}

/* ===== Topbar ===== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    background: linear-gradient(180deg, rgba(7, 10, 18, 0.78), rgba(7, 10, 18, 0.42));
    border-bottom: 1px solid var(--line);
    transform: translateY(0);
    transition: transform 200ms ease;
    will-change: transform;
}

.topbar.is-hidden {
    transform: translateY(calc(-1 * var(--topbar-h)));
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .topbar {
        transition: none !important;
    }
}

.topbar-inner.two-tier {
    max-width: var(--max);
    margin: 0 auto;
    padding: 14px 18px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.topbar-inner .top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    transform-origin: top;
    transition:
        max-height 180ms ease,
        opacity 140ms ease,
        transform 180ms ease,
        margin 180ms ease,
        padding 180ms ease;
    will-change: max-height, opacity, transform;
    overflow: hidden;
    max-height: 80px;
    opacity: 1;
    transform: translateY(0) scaleY(1);
}

.topbar-inner .bottom-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    padding-top: 8px;
    border-top: 1px solid rgba(var(--text-rgb) / 0.08);
    transition:
        padding-top 180ms ease,
        border-top-color 180ms ease;
}

.topbar-inner.two-tier {
    transition:
        padding-top 180ms ease,
        padding-bottom 180ms ease,
        gap 180ms ease;
}

.topbar.is-collapsed .top-row {
    max-height: 0;
    opacity: 0;
    transform: translateY(-6px) scaleY(0.92);
    margin: 0;
    padding: 0;
    pointer-events: none;
}

.topbar.is-collapsed .bottom-row {
    border-top-color: transparent;
    padding-top: 0;
}

.topbar.is-collapsed .topbar-inner.two-tier {
    padding-top: 10px;
    padding-bottom: 10px;
    gap: 0;
}

@media (max-width: 980px) {
    body {
        padding-top: var(--topbar-h);
    }

    .topbar {
        position: fixed;
        left: 0;
        right: 0;
        top: 0;
    }

    .topbar.is-collapsed .top-row {
        max-height: none;
        opacity: 1;
        transform: none;
        margin: 0;
        padding: 0;
        pointer-events: auto;
    }

    .topbar.is-collapsed .bottom-row {
        border-top-color: rgba(var(--text-rgb) / 0.08);
        padding-top: 8px;
    }

    .topbar.is-collapsed .topbar-inner.two-tier {
        padding: 14px 18px 10px;
        gap: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .topbar-inner .top-row,
    .topbar-inner .bottom-row,
    .topbar-inner.two-tier {
        transition: none !important;
    }
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 240px;
}

.wordmark {
    display: inline-block;
    line-height: 1.15;
    white-space: nowrap;
}

.wm-python,
.wm-dot,
.wm-financial {
    font-size: 22px;
}

.wm-python {
    font-weight: 850;
    letter-spacing: -0.9px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.98), rgba(6, 182, 212, 0.98));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.wm-dot {
    font-weight: 850;
    margin: 0 2px;
}

.wm-financial {
    font-weight: 700;
    letter-spacing: -0.35px;
}

.brand-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-title strong {
    font-size: 13px;
    letter-spacing: 0.2px;
}

.brand-title span {
    font-size: 12px;
    color: var(--text-muted);
}

.nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 760px;
}

.chip {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: rgba(var(--text-rgb) / 0.74);
    font-size: 12px;
    white-space: nowrap;
    transition: color 0.15s ease;
    position: relative;
}

.chip::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(var(--text-rgb) / 0.22), transparent);
    opacity: 0;
    transform: translateY(2px);
    transition:
        opacity 0.15s ease,
        transform 0.15s ease;
}

.chip:hover {
    color: var(--text);
    text-decoration: none;
}

.chip:hover::after {
    opacity: 1;
    transform: translateY(0);
}

.chip.is-active {
    color: var(--text);
}

.chip.is-active::after {
    opacity: 1;
    transform: translateY(0);
    background: linear-gradient(90deg, transparent, rgba(var(--text-rgb) / 0.45), transparent);
}

@media (max-width: 980px) {
    .brand {
        min-width: unset;
    }

    .topbar-inner .bottom-row {
        align-items: flex-start;
    }

    .nav {
        justify-content: flex-start;
        max-width: none;
        gap: 12px;
    }
}

/* ===== Hero ===== */
header.hero {
    padding: 34px 0 24px;
}

@media (max-width: 980px) {
    header.hero {
        padding: 0;
    }
}

.hero-card {
    position: relative;
    --g1x: 20%;
    --g1y: 0%;
    --g2x: 90%;
    --g2y: 12%;
}

.hero-card::before {
    content: "";
    position: absolute;
    inset: -2px;
    background: radial-gradient(600px 220px at var(--g1x) var(--g1y),
            rgba(124, 58, 237, 0.28),
            transparent 55%),
        radial-gradient(520px 220px at var(--g2x) var(--g2y), rgba(6, 182, 212, 0.22), transparent 55%);
    pointer-events: none;
    transition:
        filter 250ms ease,
        opacity 250ms ease;
    filter: saturate(1.02);
    opacity: 0.95;
}

.hero-card:hover::before {
    filter: saturate(1.06);
    opacity: 1;
}

.hero-inner {
    position: relative;
    padding: 20px 20px 18px;
}

h1 {
    margin: 14px 0 10px;
    font-size: clamp(28px, 3.2vw, 44px);
    line-height: 1.12;
    letter-spacing: -0.6px;
    text-wrap: balance;
}

.hero p {
    margin: 0;
    color: var(--text-muted);
    font-size: 15px;
}

.hero-meta {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-title {
    display: grid;
    grid-template-columns: 1fr 10fr;
    align-items: center;
    gap: 16px;
    margin: 14px 0 10px;
}

.hero-logo {
    width: 100%;
    height: auto;
    display: block;
    justify-self: center;
    align-self: center;
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.45)) drop-shadow(0 2px 6px rgba(124, 58, 237, 0.18));
    will-change: filter;
}

.hero-title h1 {
    margin: 0;
}

@media (max-width: 680px) {
    .hero-title {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        gap: 10px;
        margin: 10px 0 12px;
    }

    .hero-logo {
        width: 72px;
        /* fixed, consistent visual weight */
        max-width: 72px;
    }

    .hero-title h1 {
        font-size: clamp(24px, 6.2vw, 34px);
        line-height: 1.12;
        text-wrap: balance;
    }

    .hero p {
        font-size: 14px;
    }

    .hero-meta {
        justify-content: center;
    }
}

/* Chip-like UI primitives */
.meta-chip,
.badge,
.pill,
.mig-tag {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: var(--glass-3);
    font-size: 12px;
    white-space: nowrap;
}

.meta-chip {
    gap: 8px;
    padding: 7px 10px;
    color: var(--text-soft);
}

.meta-chip strong {
    color: var(--text-strong);
    font-weight: 650;
}

.meta-chip .dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent1), var(--accent2));
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}

.meta-chip .dot2 {
    background: linear-gradient(135deg, var(--accent2), rgba(var(--white-rgb) / 0.65));
    box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.12);
}

.meta-chip .dot3 {
    background: linear-gradient(135deg, var(--accent3), rgba(var(--white-rgb) / 0.65));
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}

.badge {
    gap: 8px;
    padding: 6px 10px;
    color: var(--text-soft);
}

.badge .spark {
    width: 8px;
    height: 8px;
    border-radius: 99px;
    background: linear-gradient(135deg, var(--accent1), var(--accent2));
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.14);
}

.pill {
    padding: 5px 8px;
    border: 1px solid var(--surface-border);
    color: rgba(var(--text-rgb) / 0.75);
}

.mig-tag {
    margin-bottom: 6px;
    padding: 5px 8px;
    border: 1px solid var(--surface-border);
    color: var(--text-soft);
}

.heading-pills {
    margin: -4px 0 10px;
    /* snug under heading */
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ext-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: var(--glass-3);
    color: rgba(var(--text-rgb) / 0.78);
    font-size: 12px;
    text-decoration: none;
    transition:
        transform 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease;
}

.ext-pill:hover {
    color: var(--text);
    border-color: rgba(var(--white-rgb) / 0.24);
    transform: translateY(-1px);
}

/* ===== Chooser ===== */
.chooser {
    margin-top: 14px;
}

.chooser-inner {
    padding: 16px 18px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
}

@media (max-width: 980px) {
    .chooser-inner {
        grid-template-columns: 1fr;
    }
}

.chooser h2 {
    margin: 0 0 6px;
    font-size: 14px;
    letter-spacing: 0.2px;
}

.chooser-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px 0;
}

.chooser-title {
    margin: 0;
    font-size: 13px;
    letter-spacing: 0.2px;
    color: rgba(var(--text-rgb) / 0.9);
}

.chooser-note {
    margin: 0;
    font-size: 12px;
    color: var(--text-faint);
}

.rule {
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--line-weak);
    background: var(--glass-3);
}

.rule strong {
    color: var(--text);
}

.rule span {
    display: block;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 2px;
}

/* ===== Layout grid ===== */
.grid {
    display: grid;
    grid-template-columns: 1.35fr 0.65fr;
    gap: 18px;
    margin-top: 18px;
    align-items: start;
}

@media (max-width: 980px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

.card-body {
    padding: 18px 18px 16px;
}

.aside {
    position: sticky;
    top: calc(var(--topbar-h) + 18px);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

@media (max-width: 980px) {
    .aside {
        position: static;
    }
}

.aside .mini {
    padding: 16px 16px 14px;
}

.mini {
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease,
        border-color 0.18s ease;
}

.mini h3 {
    margin: 0 0 8px;
    font-size: 13px;
    letter-spacing: 0.2px;
    color: var(--text);
}

.mini p {
    margin: 0;
    font-size: 12.5px;
    color: var(--text-muted);
}

.mini.is-active {
    border-color: var(--line-stronger);
    background: linear-gradient(180deg, var(--glass-5), rgba(var(--white-rgb) / 0.05));
    box-shadow:
        var(--elev-4),
        0 0 0 1px rgba(124, 58, 237, 0.18),
        0 0 40px rgba(6, 182, 212, 0.12);
    transform: translateY(-1px);
}

/* ===== Article typography ===== */
article {
    padding: 2px 0;
    font-size: 15.5px;
}

@media (min-width: 980px) {
    article {
        font-size: 16px;
    }

    article p,
    article ul,
    article ol {
        max-width: 78ch;
    }
}

article h2 {
    margin: 22px 0 10px;
    font-size: 20px;
    letter-spacing: -0.2px;
    line-height: 1.25;
}

article h3 {
    margin: 20px 0 8px;
    font-size: 18px;
    line-height: 1.25;
}

article h4 {
    margin: 18px 0 6px;
    font-size: 16px;
    color: var(--text);
}

article p {
    margin: 10px 0;
    color: var(--text-muted);
}

article strong,
article em {
    color: var(--text);
}

article hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(var(--white-rgb) / 0.18), transparent);
    margin: 20px 0;
}

article ul {
    color: var(--text-muted);
}

article li {
    margin: 6px 0;
}

article code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
        monospace;
    background: var(--glass-4);
    border: 1px solid var(--line-weak);
    padding: 1px 6px;
    border-radius: 9px;
    color: var(--text);
    font-size: 0.95em;
}

article h1[id],
article h2[id],
article h3[id],
article h4[id],
article h5[id],
article h6[id],
.anchor,
[data-spy-target] {
    scroll-margin-top: calc(var(--topbar-h) + 16px);
}

/* ===== Tables ===== */
.table-wrap {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    border-radius: 14px;
    border: 1px solid var(--surface-border);
    background: var(--glass-2);
    margin: 12px 0 6px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 12px;
    border-bottom: 1px solid var(--line-weak);
    vertical-align: top;
    text-align: left;
}

th {
    position: sticky;
    top: 0;
    background: rgba(7, 10, 18, 0.78);
    backdrop-filter: blur(10px);
    color: var(--text);
    font-weight: 650;
    font-size: 12.5px;
    letter-spacing: 0.2px;
}

td {
    color: var(--text-muted);
    font-size: 13px;
}

tr:hover td {
    background: var(--glass-2);
}

/* ===== Method cards ===== */
.method-grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 980px) {
    .method-grid {
        grid-template-columns: 1fr;
    }
}

.method-card {
    padding: 14px 14px 12px;
}

.method-card h4 {
    margin: 0 0 6px;
    font-size: 13px;
    letter-spacing: 0.2px;
}

.method-card p {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--text-muted);
}

/* ===== Disclosure ===== */
.disclosure {
    margin-top: 12px;
    padding: 12px 12px;
    border-radius: 16px;
    border: 1px dashed rgba(var(--white-rgb) / 0.18);
    background: var(--glass-1);
    color: rgba(var(--text-rgb) / 0.72);
    font-size: 12.5px;
}

/* ===== Migration ===== */
.migration {
    margin: 16px 0;
}

.migration-rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.migration-row {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
}

@media (max-width: 980px) {
    .migration-row {
        grid-template-columns: 1fr;
    }
}

.mig-left strong {
    display: block;
    font-size: 14px;
    letter-spacing: -0.1px;
}

.mig-left p {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 13px;
}

.mig-right ul {
    margin: 0;
    padding-left: 16px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ===== Anchors ===== */
.anchor {
    scroll-margin-top: 20px;
}

article h1,
article h2,
article h3,
article h4 {
    position: relative;
}

.anchor-link {
    display: inline-block;
    margin-left: 10px;
    opacity: 0;
    transform: translateX(-4px);
    transition:
        opacity 0.15s ease,
        transform 0.15s ease;
    color: var(--text-dim);
    font-weight: 750;
    line-height: 1;
    text-decoration: none;
}

article h1:hover .anchor-link,
article h2:hover .anchor-link,
article h3:hover .anchor-link,
article h4:hover .anchor-link {
    opacity: 1;
    transform: translateX(0);
}

.anchor-link:hover {
    color: var(--text-strong);
}

.anchor-link:focus-visible {
    opacity: 1;
    transform: translateX(0);
}

article h1[id],
article h2[id],
article h3[id],
article h4[id],
article h5[id],
article h6[id] {
    scroll-margin-top: 20px;
}

/* ===== Footer ===== */
footer {
    margin-top: 28px;
    color: var(--text-faint);
    font-size: 12px;
    text-align: center;
}

/* ===== Contact line ===== */
.contact-line {
    margin-top: 18px;
    padding: 12px 14px;
    text-align: center;
    font-size: 12.5px;
    color: var(--text-faint);
}

.contact-line a {
    color: var(--text-strong);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.contact-line a:hover {
    color: var(--text);
}

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

/* ===== Subscribe ===== */
.subscribe {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.subscribe-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.subscribe-form input {
    width: 240px;
    height: 36px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid var(--line-strong);
    background: var(--glass-3);
    color: var(--text);
    font-size: 12.5px;
    outline: none;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}

.subscribe-form input::placeholder {
    color: var(--text-dim);
}

.subscribe-form input:focus-visible {
    border-color: rgba(124, 58, 237, 0.55);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.18);
    background: rgba(var(--white-rgb) / 0.055);
}

.subscribe-form input.is-invalid {
    border-color: rgba(239, 68, 68, 0.55);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.18);
}

.subscribe-btn {
    height: 36px;
    padding: 0 14px;
    border: 0;
    border-radius: 12px;
    font-size: 12.5px;
    font-weight: 750;
    letter-spacing: 0.15px;
    color: rgba(7, 10, 18, 0.92);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: var(--elev-2);
    background: linear-gradient(135deg, var(--accent1), var(--accent2), var(--accent3), var(--accent1));
    background-size: 300% 300%;
    animation: gradientMove 2.4s ease-in-out infinite;
    transition:
        transform 0.14s ease,
        filter 0.14s ease,
        box-shadow 0.14s ease;
}

.subscribe-btn::before {
    content: "";
    position: absolute;
    inset: -40% -60%;
    background: radial-gradient(circle at 30% 30%, rgba(var(--white-rgb) / 0.35), transparent 42%);
    transform: translateX(-20%);
    opacity: 0.75;
    mix-blend-mode: overlay;
    animation: shimmer 1.9s ease-in-out infinite;
    pointer-events: none;
}

.subscribe-btn:not(:disabled):hover {
    transform: translateY(-1px);
    filter: saturate(1.05);
    box-shadow: 0 16px 40px var(--shadow-4);
}

.subscribe-btn:not(:disabled):active {
    transform: translateY(0px);
}

.subscribe-btn:disabled {
    opacity: 0.55;
    filter: grayscale(0.15) saturate(0.85);
    cursor: not-allowed;
}

.subscribe-btn.is-subscribed {
    animation: none;
    opacity: 1 !important;
    cursor: default;
    filter: saturate(1.05);
    box-shadow: var(--elev-3);
}

.subscribe-btn:disabled::before {
    animation: none;
    opacity: 0.35;
}

.subscribe-btn.is-success {
    animation: none;
    filter: saturate(1.05);
    box-shadow: var(--elev-3);
}

/* Animations */
@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-25%);
        opacity: 0.55;
    }

    50% {
        transform: translateX(12%);
        opacity: 0.8;
    }

    100% {
        transform: translateX(-25%);
        opacity: 0.55;
    }
}

/* Mobile handling */
@media (max-width: 680px) {
    .topbar-inner .top-row {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .subscribe {
        width: 100%;
        justify-content: flex-start;
    }

    .subscribe-form {
        width: 100%;
    }

    .subscribe-form input {
        width: 100%;
        flex: 1;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        scroll-behavior: auto !important;
    }

    .mini.is-active {
        transform: none;
    }

    .subscribe-btn,
    .subscribe-btn::before {
        animation: none !important;
    }
}

/* Reduced transparency */
@media (prefers-reduced-transparency: reduce) {
    .topbar {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}
