:root {
    --bios-ink: #071827;
    --bios-deep: #061926;
    --bios-deeper: #03101a;
    --bios-teal: #0f6f75;
    --bios-teal-bright: #5ee6cf;
    --bios-green: #8bffbf;
    --bios-sky: #dff7ff;
    --bios-mist: #eef7fb;
    --bios-paper: #ffffff;
    --bios-muted: #5d7180;
    --bios-line: rgba(7, 24, 39, 0.14);
    --bios-line-dark: rgba(255, 255, 255, 0.14);
    --bios-radius: 22px;
    --bios-radius-small: 12px;
    --bios-shadow: 0 24px 70px rgba(3, 16, 26, 0.14);
    --bios-font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --bios-font-serif: Georgia, "Times New Roman", serif;
    --bios-shell: min(1120px, calc(100vw - 40px));
    --bios-shell-wide: min(1320px, calc(100vw - 40px));
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.bios-theme {
    margin: 0;
    color: var(--bios-ink);
    font-family: var(--bios-font-sans);
    background:
        radial-gradient(circle at top left, rgba(94, 230, 207, 0.14), transparent 34rem),
        linear-gradient(180deg, #f6fbfd 0%, #eef7fb 42%, #ffffff 100%);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.admin-bar .bios-site-header {
    top: 32px;
}

a {
    color: #007d78;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.18em;
}

a:hover,
a:focus-visible {
    color: #005c5a;
}

img,
svg,
video {
    max-width: 100%;
    height: auto;
}

.screen-reader-text,
.bios-skip-link {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.bios-skip-link:focus {
    top: 12px;
    left: 12px;
    z-index: 100000;
    width: auto;
    height: auto;
    padding: 10px 14px;
    clip: auto;
    color: var(--bios-deep);
    background: var(--bios-green);
    border-radius: 999px;
}

.bios-shell {
    width: var(--bios-shell);
    margin-inline: auto;
}

.bios-shell--wide {
    width: var(--bios-shell-wide);
}

.bios-site-header {
    position: sticky;
    top: 0;
    z-index: 999;
    background: rgba(3, 16, 26, 0.86);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--bios-line-dark);
}

.bios-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 26px;
    min-height: 82px;
    padding-block: 12px;
}

.bios-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.bios-logo-link {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    text-decoration: none;
}

.bios-logo-img,
.custom-logo {
    display: block;
    width: 170px;
    max-height: 66px;
    object-fit: contain;
}

.bios-brand-kicker,
.bios-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    color: var(--bios-teal-bright);
    font-size: 0.77rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    line-height: 1.2;
    text-transform: uppercase;
}

.bios-brand-kicker {
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.68rem;
}

.bios-primary-navigation {
    display: flex;
    align-items: center;
}

.bios-primary-menu,
.bios-footer-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.bios-primary-menu {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bios-primary-menu a {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 13px;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
}

.bios-primary-menu a:hover,
.bios-primary-menu a:focus-visible,
.bios-primary-menu .current-menu-item > a,
.bios-primary-menu .current_page_item > a {
    color: var(--bios-deep);
    background: var(--bios-teal-bright);
}

.bios-menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
}

.bios-menu-toggle__bar {
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 99px;
}

.bios-main {
    min-height: 62vh;
    padding: clamp(28px, 4vw, 56px) 0;
}

.bios-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.46fr);
    gap: clamp(28px, 5vw, 64px);
    align-items: center;
    overflow: hidden;
    padding: clamp(32px, 5vw, 70px);
    color: #fff;
    background:
        radial-gradient(circle at 84% 16%, rgba(94, 230, 207, 0.32), transparent 20rem),
        linear-gradient(135deg, #061926 0%, #0c3942 55%, #061926 100%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: calc(var(--bios-radius) + 8px);
    box-shadow: var(--bios-shadow);
}

.bios-hero--compact {
    grid-template-columns: 1fr;
}

.bios-hero h1,
.bios-page-header h1,
.bios-single-header h1,
.bios-archive-header h1 {
    margin: 0;
    color: inherit;
    font-family: var(--bios-font-serif);
    font-size: clamp(2.6rem, 6vw, 5.8rem);
    line-height: 0.96;
    letter-spacing: -0.045em;
}

.bios-page-header h1,
.bios-single-header h1,
.bios-archive-header h1 {
    color: var(--bios-ink);
    font-size: clamp(2.35rem, 5vw, 4.8rem);
}

.bios-hero__lead,
.bios-archive-header p,
.bios-page-header p,
.bios-single-meta,
.bios-muted {
    color: rgba(255, 255, 255, 0.75);
    font-size: clamp(1.05rem, 2vw, 1.28rem);
}

.bios-archive-header p,
.bios-page-header p,
.bios-single-meta,
.bios-muted {
    color: var(--bios-muted);
}

.bios-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.bios-button,
.wp-block-button__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px 20px;
    border: 0;
    border-radius: 999px;
    color: var(--bios-deep) !important;
    background: var(--bios-teal-bright);
    font-weight: 900;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 12px 26px rgba(94, 230, 207, 0.24);
}

.bios-button:hover,
.bios-button:focus-visible,
.wp-block-button__link:hover,
.wp-block-button__link:focus-visible {
    transform: translateY(-1px);
    color: var(--bios-deep) !important;
    background: var(--bios-green);
}

.bios-button--ghost {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.26);
    box-shadow: none;
}

.bios-button--ghost:hover,
.bios-button--ghost:focus-visible {
    color: var(--bios-deep) !important;
}

.bios-hero__panel {
    position: relative;
    min-height: 260px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--bios-radius);
    background: rgba(3, 16, 26, 0.35);
}

.bios-pulse-orb {
    position: absolute;
    inset: auto 50% 50% auto;
    width: 170px;
    aspect-ratio: 1;
    border-radius: 999px;
    background:
        radial-gradient(circle, rgba(94, 230, 207, 0.95) 0 16%, rgba(94, 230, 207, 0.2) 17% 31%, transparent 32%),
        conic-gradient(from 210deg, #5ee6cf, #8bffbf, #0f6f75, #5ee6cf);
    transform: translate(50%, 45%);
    opacity: 0.9;
    animation: bios-heartbeat 7.5s ease-in-out infinite;
    filter: drop-shadow(0 0 34px rgba(94, 230, 207, 0.28));
}

@keyframes bios-heartbeat {
    0%, 88%, 100% { transform: translate(50%, 45%) scale(1); }
    8% { transform: translate(50%, 45%) scale(1.04); }
    14% { transform: translate(50%, 45%) scale(0.99); }
    22% { transform: translate(50%, 45%) scale(1.025); }
    28% { transform: translate(50%, 45%) scale(1); }
}

.bios-card {
    color: #f6fbfd;
    background:
        linear-gradient(180deg, rgba(9, 38, 54, 0.98), rgba(6, 25, 38, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--bios-radius);
    box-shadow: var(--bios-shadow);
}

.bios-card--light {
    color: var(--bios-ink);
    background: var(--bios-paper);
    border-color: var(--bios-line);
}

.bios-content,
.bios-single,
.bios-page,
.bios-archive-header,
.bios-contact-layout,
.bios-dashboard-page {
    margin-top: clamp(28px, 4vw, 56px);
}

.bios-page,
.bios-single,
.bios-archive-header {
    padding: clamp(22px, 4vw, 48px);
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(7, 24, 39, 0.08);
    border-radius: var(--bios-radius);
    box-shadow: 0 16px 44px rgba(7, 24, 39, 0.08);
}

.bios-content {
    font-size: 1.06rem;
}

.bios-content > *:first-child {
    margin-top: 0;
}

.bios-content > *:last-child {
    margin-bottom: 0;
}

.bios-content h2,
.bios-content h3,
.bios-post-card__title,
.bios-contact-side h2,
.bios-section-heading h2 {
    font-family: var(--bios-font-serif);
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.bios-content h2 {
    margin-top: 2.1em;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.bios-content h3 {
    margin-top: 1.8em;
    font-size: clamp(1.35rem, 2vw, 1.8rem);
}

.bios-content p,
.bios-content li {
    max-width: 76ch;
}

.bios-content--wide p,
.bios-content--wide li,
.bios-content .alignwide,
.bios-content .alignfull {
    max-width: none;
}

.bios-content table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: var(--bios-radius-small);
    background: #fff;
}

.bios-content th,
.bios-content td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--bios-line);
    text-align: left;
    vertical-align: top;
}

.bios-content th {
    color: #fff;
    background: var(--bios-deep);
}

.bios-content input,
.bios-content select,
.bios-content textarea,
.bios-contact-side input,
.bios-contact-side select,
.bios-contact-side textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    color: var(--bios-ink);
    border: 1px solid rgba(7, 24, 39, 0.18);
    border-radius: 12px;
    background: #fff;
}

.bios-content button,
.bios-content input[type="submit"],
.bios-contact-side button,
.bios-contact-side input[type="submit"] {
    width: auto;
    min-height: 44px;
    padding: 10px 18px;
    border: 0;
    border-radius: 999px;
    color: var(--bios-deep);
    background: var(--bios-teal-bright);
    font-weight: 900;
    cursor: pointer;
}

.bios-post-grid {
    display: grid;
    gap: 18px;
    margin-top: 28px;
}

.bios-post-card {
    display: grid;
    grid-template-columns: minmax(0, 0.32fr) minmax(0, 1fr);
    overflow: hidden;
}

.bios-post-card__image img {
    width: 100%;
    height: 100%;
    min-height: 240px;
    object-fit: cover;
}

.bios-post-card__body {
    padding: clamp(22px, 4vw, 38px);
}

.bios-post-card__title {
    margin: 0 0 10px;
    font-size: clamp(1.7rem, 3vw, 2.45rem);
}

.bios-post-card__title a {
    color: #fff;
    text-decoration: none;
}

.bios-post-card__meta {
    margin-bottom: 14px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.92rem;
    font-weight: 700;
}

.bios-post-card__excerpt {
    color: rgba(255, 255, 255, 0.82);
}

.bios-text-link {
    display: inline-flex;
    margin-top: 10px;
    color: var(--bios-teal-bright);
    font-weight: 900;
    text-decoration: none;
}

.bios-pagination {
    margin-top: 32px;
}

.bios-pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.bios-pagination .page-numbers {
    min-width: 40px;
    padding: 9px 12px;
    border-radius: 999px;
    color: var(--bios-ink);
    background: rgba(255, 255, 255, 0.8);
    text-align: center;
    text-decoration: none;
}

.bios-pagination .current {
    color: var(--bios-deep);
    background: var(--bios-teal-bright);
}

.bios-single-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
    font-size: 0.95rem;
    font-weight: 800;
}

.bios-featured-image {
    margin: 28px 0;
    overflow: hidden;
    border-radius: var(--bios-radius);
}

.bios-featured-image img {
    display: block;
    width: 100%;
}

.bios-contact-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.44fr);
    gap: 22px;
    align-items: start;
}

.bios-contact-main,
.bios-contact-side {
    padding: clamp(22px, 4vw, 40px);
}

.bios-contact-side {
    position: sticky;
    top: 110px;
}

.bios-section-heading {
    margin: 0 0 18px;
}

.bios-section-heading h2 {
    margin: 0;
    font-size: clamp(1.9rem, 4vw, 3.4rem);
}

.bios-shortcode-section {
    margin-top: clamp(28px, 5vw, 56px);
}

.bios-empty-state {
    padding: 32px;
}

.bios-site-footer {
    margin-top: clamp(34px, 6vw, 80px);
    color: rgba(255, 255, 255, 0.78);
    background: var(--bios-deeper);
    border-top: 1px solid var(--bios-line-dark);
}

.bios-footer-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.6fr 0.8fr;
    gap: clamp(24px, 4vw, 54px);
    padding-block: clamp(32px, 5vw, 62px);
}

.bios-footer-brand .bios-logo-img,
.bios-footer-brand .custom-logo {
    width: 150px;
}

.bios-footer-column h2 {
    margin: 0 0 10px;
    color: #fff;
    font-family: var(--bios-font-serif);
    font-size: 1.35rem;
}

.bios-footer-menu {
    display: grid;
    gap: 8px;
}

.bios-footer-menu a,
.bios-footer-credit a {
    color: var(--bios-teal-bright);
    font-weight: 800;
    text-decoration: none;
}

.bios-footer-credit {
    padding: 14px 20px 18px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.82rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.bios-footer-version {
    white-space: nowrap;
}

.bios-canvas-template {
    background: #fff;
}

.bios-main--canvas {
    padding: 0;
}

.bios-canvas-content > *:first-child {
    margin-top: 0;
}

.bios-footer-credit--canvas {
    color: var(--bios-muted);
    background: #fff;
    border-top: 1px solid var(--bios-line);
}

/* Plugin-friendly normalisation. */
.signals-wrap,
.signals-page,
.signals-dashboard,
.bios-radar-wrap,
.bios-earth-monitor {
    max-width: none !important;
}

.bios-shortcode-section .signals-footer {
    display: none;
}

@media (max-width: 960px) {
    body.admin-bar .bios-site-header {
        top: 46px;
    }

    .bios-menu-toggle {
        display: inline-flex;
    }

    .bios-primary-navigation {
        position: absolute;
        top: 100%;
        left: 20px;
        right: 20px;
        display: none;
        padding: 14px;
        background: rgba(3, 16, 26, 0.96);
        border: 1px solid var(--bios-line-dark);
        border-radius: 18px;
        box-shadow: var(--bios-shadow);
    }

    .bios-primary-navigation.is-open {
        display: block;
    }

    .bios-primary-menu {
        display: grid;
        gap: 6px;
    }

    .bios-primary-menu a {
        justify-content: center;
        min-height: 46px;
    }

    .bios-brand-copy {
        display: none;
    }

    .bios-hero,
    .bios-contact-layout,
    .bios-footer-grid,
    .bios-post-card {
        grid-template-columns: 1fr;
    }

    .bios-contact-side {
        position: static;
    }

    .bios-post-card__image img {
        min-height: 220px;
    }
}

@media (max-width: 640px) {
    :root {
        --bios-shell: min(100vw - 26px, 1120px);
        --bios-shell-wide: min(100vw - 26px, 1320px);
    }

    .bios-header-inner {
        min-height: 72px;
    }

    .bios-logo-img,
    .custom-logo {
        width: 132px;
    }

    .bios-main {
        padding-block: 20px;
    }

    .bios-hero,
    .bios-page,
    .bios-single,
    .bios-archive-header,
    .bios-contact-main,
    .bios-contact-side,
    .bios-post-card__body {
        padding: 22px;
        border-radius: 18px;
    }

    .bios-hero h1,
    .bios-page-header h1,
    .bios-single-header h1,
    .bios-archive-header h1 {
        font-size: clamp(2.25rem, 13vw, 3.4rem);
        line-height: 1;
    }

    .bios-hero__panel {
        min-height: 190px;
    }

    .bios-pulse-orb {
        width: 130px;
    }

    .bios-button,
    .wp-block-button__link {
        width: 100%;
    }

    .bios-content table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* -------------------------------------------------------------------------
   Signals v0.9.x compatibility layer
   Keeps the BIOS theme as a clean shell while the Signals plugin remains the
   data/radar/briefing engine. Scoped to avoid fighting plugin component CSS.
   ------------------------------------------------------------------------- */

body.signals-virtual-page {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(94, 230, 207, 0.10), transparent 34rem),
        linear-gradient(180deg, #f6fbfd 0%, #eef7fb 42%, #ffffff 100%);
}

.bios-plugin-page,
.bios-radar-page {
    display: grid;
    gap: clamp(22px, 3vw, 34px);
}

.bios-plugin-empty {
    padding: 24px;
    color: var(--bios-deep);
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid var(--bios-line);
}

.bios-radar-frame {
    overflow: hidden;
    padding: clamp(16px, 2.4vw, 26px);
    color: #eaf3f2;
    background:
        radial-gradient(circle at 82% 8%, rgba(94, 230, 207, 0.14), transparent 22rem),
        linear-gradient(135deg, #061926 0%, #0b2235 55%, #061926 100%);
    border: 1px solid rgba(94, 230, 207, 0.18);
    border-radius: calc(var(--bios-radius) + 4px);
    box-shadow: var(--bios-shadow);
}

.bios-radar-frame .bios-radar-root {
    min-height: 420px;
}

.bios-shortcode-section--radar .bios-radar-root,
.bios-content .bios-radar-root {
    margin-block: 12px;
}

.bios-shortcode-section--dashboard .signals-dashboard-shell,
.bios-shortcode-section--briefings .signals-dashboard-wrap,
.bios-shortcode-section--sources .signals-dashboard-wrap {
    margin-inline: auto;
}

.bios-theme .signals-shell {
    width: min(1180px, calc(100vw - 40px));
}

.bios-theme .signals-dashboard-wrap,
.bios-theme .signals-contact-wrap,
.bios-theme .signals-briefings-source-wrap {
    border-radius: var(--bios-radius);
}

.bios-page-header--radar p:last-child,
.bios-plugin-page .bios-page-header p:last-child {
    max-width: 760px;
    color: var(--bios-muted);
}

@media (max-width: 720px) {
    .bios-radar-frame {
        width: calc(100vw - 24px);
        margin-left: 50%;
        transform: translateX(-50%);
        padding: 12px;
        border-radius: 18px;
    }

    .bios-radar-frame .bios-radar-root .br-controls {
        align-items: stretch;
    }

    .bios-radar-frame .bios-radar-root select.br-sel {
        min-width: 100%;
    }
}
