/* ═══════════════════════════════════════════════════════
   AXIOM — nav.css
   Top nav · Sidebar · Mobile menu · Bottom nav bar
   ═══════════════════════════════════════════════════════ */

/* ── Top Nav Bar ─────────────────────────────────────── */
.axm-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    background: var(--axm-surface);
    box-shadow: var(--neo-nav);
    transition: box-shadow var(--t-slow), background var(--t-slow), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

.axm-nav--hidden {
    transform: translateY(-100%) !important;
    box-shadow: none !important;
    pointer-events: none;
    position: absolute !important;
}

.axm-nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 5rem;
    padding: 0 2rem;
    max-width: 1440px;
    margin: 0 auto;
    gap: 1rem;
}

.axm-nav__brand {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--axm-primary);
    text-decoration: none;
    white-space: nowrap;
    transition: transform var(--t-base), color var(--t-base);
    flex-shrink: 0;
}

.axm-nav__brand:hover {
    transform: scale(0.96);
    color: var(--axm-primary);
}

/* Nav links (desktop) */
.axm-nav__links {
    display: none;
}

@media (min-width: 768px) {
    .axm-nav__links {
        display: flex;
        align-items: center;
        gap: 0;
    }
}

.axm-nav__menu {
    display: flex;
    list-style: none;
    gap: 0;
    margin: 0;
    padding: 0;
}

.axm-nav__menu a {
    display: block;
    padding: 0.5rem 1.25rem;
    border-radius: var(--r-lg);
    color: var(--axm-on-surface-variant);
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    transition: all var(--t-base);
}

.axm-nav__menu a:hover {
    color: var(--axm-primary);
}

.axm-nav__menu .current-menu-item a,
.axm-nav__item--active a {
    color: var(--axm-primary);
    border-bottom: 2px solid var(--axm-primary);
    box-shadow: var(--neo-pressed);
}

/* Trailing actions */
.axm-nav__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Icon button (shared) */
.axm-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--r-full);
    border: none;
    cursor: pointer;
    background: var(--axm-surface);
    color: var(--axm-on-surface-variant);
    box-shadow: var(--neo-raised);
    transition: all var(--t-base);
}

.axm-icon-btn:hover {
    color: var(--axm-primary);
    transform: translateY(-1px);
}

.axm-icon-btn:active {
    box-shadow: var(--neo-pressed);
    transform: scale(0.95);
}

.axm-icon-btn .material-symbols-outlined {
    font-size: 1.25rem;
}

/* Dark mode icon swap */
.axm-theme-icon--dark {
    display: none !important;
}

.axm-theme-icon--light {
    display: inline-block !important;
}

html.dark .axm-theme-icon--light {
    display: none !important;
}

html.dark .axm-theme-icon--dark {
    display: inline-block !important;
}

/* Primary button */
.axm-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.5rem;
    border-radius: var(--r-lg);
    border: none;
    cursor: pointer;
    background: var(--axm-surface);
    color: var(--axm-primary-text);
    font-weight: 600;
    font-size: 0.875rem;
    font-family: inherit;
    box-shadow: var(--neo-raised);
    text-decoration: none;
    white-space: nowrap;
    transition: all var(--t-base);
}

.axm-btn-primary:hover {
    color: var(--axm-tertiary-text);
    transform: translateY(-1px);
}

.axm-btn-primary:active {
    box-shadow: var(--neo-pressed);
    transform: scale(0.97);
}

.axm-btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    border-radius: var(--r-lg);
    border: none;
    cursor: pointer;
    background: var(--axm-surface);
    color: var(--axm-primary-text);
    font-weight: 600;
    font-size: 0.875rem;
    font-family: inherit;
    box-shadow: var(--neo-raised);
    text-decoration: none;
    transition: all var(--t-base);
}

.axm-btn-outline:hover {
    color: var(--axm-tertiary-text);
}

.axm-btn-outline:active {
    box-shadow: var(--neo-pressed);
}

/* ── Account Dropdown ─────────────────────────────────── */
.axm-nav__account {
    position: relative;
}

.axm-account-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--r-full);
    border: none;
    cursor: pointer;
    background: var(--axm-surface);
    box-shadow: var(--neo-raised);
    padding: 0;
    overflow: hidden;
    transition: all var(--t-base);
}

.axm-account-btn:hover {
    box-shadow: var(--neo-float);
}

.axm-account-btn__avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--r-full);
}

.axm-account-dropdown {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    min-width: 14rem;
    background: var(--axm-surface);
    border-radius: var(--r-lg);
    box-shadow: var(--neo-float);
    padding: 0.5rem;
    z-index: 100;
}

.axm-account-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--r-md);
    color: var(--axm-on-surface-variant);
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all var(--t-fast);
}

.axm-account-dropdown a:hover {
    background: var(--axm-surface-container);
    color: var(--axm-primary);
    box-shadow: var(--neo-pressed);
}

.axm-account-dropdown .material-symbols-outlined {
    font-size: 1.125rem;
}

.axm-dropdown-divider {
    border: none;
    border-top: 1px solid var(--axm-outline-variant);
    margin: 0.25rem 0;
}

/* ── Search + Notifications ───────────────────────────── */
.axm-nav-search {
    position: fixed;
    top: 4.75rem;
    left: 50%;
    transform: translateX(-50%);
    width: min(44rem, calc(100vw - 2rem));
    z-index: 95;
    padding: 0.75rem;
    border-radius: var(--r-lg);
    background: var(--axm-surface);
}

.axm-nav-search form {
    display: grid;
    grid-template-columns: auto 1fr minmax(7rem, auto) auto;
    align-items: center;
    gap: 0.625rem;
}

.axm-nav-search input,
.axm-nav-search select {
    min-width: 0;
    border: none;
    border-radius: var(--r-md);
    padding: 0.7rem 0.85rem;
    background: var(--axm-surface);
    box-shadow: var(--neo-pressed);
    color: var(--axm-on-surface);
    font: inherit;
}

.axm-notifications {
    position: relative;
}

.axm-notifications__badge {
    position: absolute;
    top: -0.25rem;
    right: -0.2rem;
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.25rem;
    border-radius: var(--r-full);
    background: var(--axm-error);
    color: var(--axm-on-error);
    font-size: 0.65rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.axm-notifications__menu {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    width: min(22rem, calc(100vw - 2rem));
    max-height: 26rem;
    overflow: auto;
    padding: 0.5rem;
    border-radius: var(--r-lg);
    background: var(--axm-surface);
    z-index: 100;
}

.axm-notifications__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 0.75rem;
    color: var(--axm-on-surface);
}

.axm-notifications__head span {
    color: var(--axm-primary);
    font-size: 0.75rem;
    font-weight: 800;
}

.axm-notifications__item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--r-md);
    color: var(--axm-on-surface-variant);
    text-decoration: none;
}

.axm-notifications__item:hover,
.axm-notifications__item--unread {
    background: var(--axm-surface-container);
}

.axm-notifications__item .material-symbols-outlined {
    color: var(--axm-primary);
}

.axm-notifications__item strong,
.axm-notifications__item small {
    display: block;
}

.axm-notifications__item strong {
    color: var(--axm-on-surface);
    font-size: 0.875rem;
}

.axm-notifications__item small,
.axm-notifications__empty {
    color: var(--axm-on-surface-variant);
    font-size: 0.8rem;
    line-height: 1.45;
}

.axm-notifications__empty {
    margin: 0;
    padding: 1rem 0.75rem;
}

@media (max-width: 640px) {
    .axm-nav-search form {
        grid-template-columns: auto 1fr;
    }

    .axm-nav-search select,
    .axm-nav-search button {
        grid-column: 1 / -1;
        width: 100%;
    }
}

/* Hamburger - hidden on desktop */
.axm-hamburger {
    display: flex;
}

@media (min-width: 768px) {
    .axm-hamburger {
        display: none;
    }
}

/* ── Left Sidebar ─────────────────────────────────────── */
.axm-sidebar {
    display: none;
    flex-direction: column;
    position: sticky;
    top: 5rem;
    align-self: start;
    width: 16rem;
    height: calc(100vh - 5rem);
    background: var(--axm-surface);
    box-shadow: var(--neo-nav);
    z-index: 40;
    overflow-y: auto;
    padding: 1.5rem 1rem 2rem;
    gap: 0.5rem;
    scrollbar-width: thin;
}

@media (min-width: 768px) {
    .axm-sidebar {
        display: flex;
    }
}

/* Sidebar profile chip */
.axm-sidebar__profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: var(--r-lg);
    box-shadow: var(--neo-pressed);
    margin-bottom: 1.5rem;
}

.axm-sidebar__avatar {
    width: 3rem;
    height: 3rem;
    border-radius: var(--r-full);
    object-fit: cover;
    box-shadow: var(--neo-raised);
}

.axm-sidebar__name {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--axm-on-surface);
}

.axm-sidebar__sub {
    font-size: 0.75rem;
    color: var(--axm-on-surface-variant);
}

/* Sidebar nav links */
.axm-sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.axm-sidebar__link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--r-lg);
    color: var(--axm-on-surface-variant);
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all var(--t-base);
}

.axm-sidebar__link:hover {
    color: var(--axm-primary-text);
    box-shadow: var(--neo-raised);
}

.axm-sidebar__link--active {
    color: var(--axm-primary-text);
    box-shadow: var(--neo-pressed);
}

.axm-sidebar__link .material-symbols-outlined {
    font-size: 1.25rem;
}

/* Sidebar CTA */
.axm-sidebar__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem 1rem;
    border: none;
    border-radius: var(--r-lg);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--axm-primary-text);
    background: var(--axm-surface);
    box-shadow: var(--neo-raised);
    text-decoration: none;
    margin-top: auto;
    transition: all var(--t-base);
}

.axm-sidebar__cta:hover {
    color: var(--axm-tertiary-text);
    box-shadow: var(--neo-float);
}

.axm-sidebar__cta:active {
    box-shadow: var(--neo-pressed);
}

/* ── Mobile Menu Drawer ───────────────────────────────── */
.axm-mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
}

.axm-mobile-menu[hidden] {
    display: none;
}

.axm-mobile-menu__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
}

.axm-mobile-menu__panel {
    position: relative;
    z-index: 1;
    width: min(20rem, 85vw);
    height: 100%;
    background: var(--axm-surface);
    box-shadow: var(--neo-float);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
    animation: slideInLeft var(--t-slow) ease;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.axm-mobile-menu__close {
    align-self: flex-end;
    margin-bottom: 1rem;
}

.axm-mobile-menu__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.axm-mobile-menu__item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    border-radius: var(--r-lg);
    color: var(--axm-on-surface-variant);
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    transition: all var(--t-base);
}

.axm-mobile-menu__item:hover {
    color: var(--axm-primary);
    box-shadow: var(--neo-raised);
}

.axm-mobile-menu__item .material-symbols-outlined {
    font-size: 1.25rem;
}

.axm-mobile-menu__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: var(--r-lg);
    background: var(--axm-surface);
    color: var(--axm-primary);
    font-weight: 700;
    font-size: 0.875rem;
    text-decoration: none;
    margin-top: auto;
    box-shadow: var(--neo-raised);
    transition: all var(--t-base);
}

/* ── Bottom Nav Bar (mobile only) ────────────────────── */
.axm-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: var(--axm-surface);
    box-shadow: var(--neo-bottom-nav);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    height: calc(5rem + env(safe-area-inset-bottom, 0px) + 8px);
    padding: 0 1.5rem;
    justify-content: space-around;
    align-items: center;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
    will-change: transform;
}

.axm-bottom-nav--hidden {
    transform: translateY(100%) !important;
    pointer-events: none;
}

@media (min-width: 768px) {
    .axm-bottom-nav {
        display: none;
    }
}

.axm-bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    min-width: 4rem;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--axm-on-surface-variant);
    font-family: inherit;
    font-size: 0.625rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--t-base);
    border-radius: var(--r-md);
}

.axm-bottom-nav__item--active {
    color: var(--axm-primary-text);
}

.axm-bottom-nav__pill {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 2rem;
    border-radius: var(--r-full);
}

.axm-bottom-nav__item--active .axm-bottom-nav__pill {
    background: var(--axm-surface-container);
    box-shadow: var(--neo-pressed);
}

.axm-bottom-nav__pill .material-symbols-outlined {
    font-size: 1.375rem;
}

/* ── Feed Layout ──────────────────────────────────────── */
.axm-feed-layout {
    display: flex;
    flex: 1;
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
    position: relative;
}

@media (min-width: 768px) {
    .axm-feed-layout {
        padding-left: 0;
    }
}

.axm-main-feed {
    flex: 1;
    padding: 2rem 1.5rem 8rem;
    min-width: 0;
}

@media (min-width: 1024px) {
    .axm-main-feed {
        padding: 2.5rem 3rem 4rem;
    }
}

/* ── Account button initials fallback (no Gravatar) ─── */
.axm-account-btn__initials {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--r-full);
    background: var(--axm-primary);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1;
    flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════
   CUSTOM LOGO — constrained, responsive, no overflow
   ════════════════════════════════════════════════════════ */

/* Wrapper div we control */
.axm-nav__brand--logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    max-width: 220px;
    /* increased from 160px */
    height: 60px;
    line-height: 0;
}

/* The <a> WP outputs */
.axm-nav__brand--logo .axm-logo-link,
.axm-nav__brand--logo .custom-logo-link {
    display: flex;
    align-items: center;
    line-height: 0;
    text-decoration: none;
}

/* The <figure> WP wraps around the img */
.axm-nav__brand--logo figure {
    margin: 0;
    padding: 0;
    line-height: 0;
    display: flex;
    align-items: center;
}

/* THE KEY RULE — constrain the actual image */
.axm-nav__brand--logo img.custom-logo {
    height: 60px !important;
    /* increased from 36px */
    width: 60px !important;
    /* lock square 1:1 aspect ratio to prevent CLS */
    aspect-ratio: 1 / 1;
    max-width: 200px !important;
    /* increased from 150px */
    object-fit: contain;
    display: block;
}

/* Responsive: slightly smaller on mobile */
@media (max-width: 640px) {
    .axm-nav__brand--logo {
        max-width: 140px;
        height: 44px;
    }

    .axm-nav__brand--logo img.custom-logo {
        height: 44px !important;
        width: 44px !important;
        aspect-ratio: 1 / 1;
        max-width: 130px !important;
    }
}

html.dark img.custom-logo.axm-logo-invert:not(.axm-logo-colour),
html.dark .axm-nav__brand--logo img.custom-logo.axm-logo-invert:not(.axm-logo-colour) {
    filter: none;
    background-color: #ffffff !important;
    border-radius: 50% !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4) !important;
}

/* ── Animated Site Name Gimmicks (looping branding title animation) ── */
:root {
    --obs-dur: 8s;
    --obs-3d-x: 135px; /* Sweeps wide past the left and right edges of the title */
    --obs-3d-y: 35px;  /* Sweeps clearly down below the title and up above the title */
    --obs-dur-earth: 50s; /* Very slow, majestic revolution speed (faster than Sun) */
    --obs-dur-moon: 8s;   /* Slow, peaceful moon orbit speed */
    --obs-dur-sun: 90s;   /* Extremely slow, majestic sun orbit period */
    --obs-sun-x: 110px;   /* Sun horizontal sweep */
    --obs-sun-y: 22px;    /* Sun vertical sweep */
}

/* On hover, keep the same serene, slow speed. No fast movement! */
.axm-nav__brand:hover {
    --obs-dur: 8s;
    --obs-dur-earth: 50s;
    --obs-dur-moon: 8s;
    --obs-dur-sun: 90s;
}

@media (max-width: 768px) {
    :root {
        --obs-3d-x: 72px;  /* Constrain sweep past the left/right edges to strictly fit within screen */
        --obs-3d-y: 20px;  /* Constrain vertical sweep to prevent screen edge overflow */
        --obs-sun-x: 58px; /* Constrain Sun horizontal sweep */
        --obs-sun-y: 12px; /* Constrain Sun vertical sweep */
    }
}

.axm-nav__site-name {
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    -webkit-text-fill-color: initial !important;
    color: var(--axm-primary) !important;
    display: inline-block !important;
    position: relative !important;
    text-decoration: none !important;
    will-change: transform, opacity;
}

.axm-nav__brand:hover .axm-nav__site-name {
    filter: drop-shadow(0 2px 8px color-mix(in srgb, var(--axm-primary) 40%, transparent));
}

/* Scanning underline — very elegant, thin, and subtle spectrograph sweep */
.axm-nav__site-name::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 1px; /* Very thin and elegant */
    background: var(--axm-tertiary) !important; /* Solid brand tertiary color */
    box-shadow: none !important; /* Removed heavy overpowering shadow */
    opacity: 0;
    will-change: transform, opacity;
    animation: obs-scan var(--obs-dur) ease-in-out infinite;
}

@keyframes obs-scan {
    0%        { transform: scaleX(0); transform-origin: left;  opacity: 0;   }
    10%       { transform: scaleX(0); transform-origin: left;  opacity: 0.4; } /* Soft and subtle opacity */
    40%       { transform: scaleX(1); transform-origin: left;  opacity: 0.4; }
    50%       { transform: scaleX(1); transform-origin: right; opacity: 0.4; }
    80%       { transform: scaleX(0); transform-origin: right; opacity: 0.4; }
    90%, 100% { transform: scaleX(0); opacity: 0; }
}

/* ── Sun, Earth, Moon Nested Orbits (3D Elliptic Loop All Around Title, Borderless) ── */
.obs-word, .obs-apos, .obs-log {
    position: relative;
    z-index: 1; /* Keep text at z-index 1 so Earth sweeps in front (z-index: 2) and behind (z-index: -1) */
}

.obs-system {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none;
    will-change: opacity;
    animation: obs-system-vis var(--obs-dur) ease-in-out infinite;
}

@keyframes obs-system-vis {
    0%, 10% { opacity: 0; }
    20%, 80% { opacity: 0.85; }
    90%, 100% { opacity: 0; }
}

.obs-sun {
    position: absolute;
    top: 58% !important; /* Centered visually on the letters to perfectly loop all around the title */
    left: 50% !important;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--axm-tertiary) !important; /* All same elegant brand tertiary color! */
    box-shadow: 0 0 5px var(--axm-tertiary) !important;
    will-change: transform, opacity;
    z-index: 2; /* Sits in front when passing in front */
    animation: obs-sun-3d var(--obs-dur-sun) linear infinite;
}

@keyframes obs-sun-3d {
    0% {
        transform: translate(-50%, -50%) translate3d(var(--obs-sun-x), 0, 0);
        opacity: 0.65;
        z-index: 2;
    }
    12.5% {
        transform: translate(-50%, -50%) translate3d(calc(var(--obs-sun-x) * 0.707), calc(var(--obs-sun-y) * 0.707), 0);
        opacity: 0.65;
        z-index: 2;
    }
    25% {
        transform: translate(-50%, -50%) translate3d(0, var(--obs-sun-y), 0);
        opacity: 0.65;
        z-index: 2;
    }
    37.5% {
        transform: translate(-50%, -50%) translate3d(calc(-0.707 * var(--obs-sun-x)), calc(var(--obs-sun-y) * 0.707), 0);
        opacity: 0.65;
        z-index: 2;
    }
    45% {
        transform: translate(-50%, -50%) translate3d(calc(-0.95 * var(--obs-sun-x)), calc(0.3 * var(--obs-sun-y)), 0);
        opacity: 0.5;
        z-index: 2;
    }
    50% {
        transform: translate(-50%, -50%) translate3d(calc(-1 * var(--obs-sun-x)), 0, 0);
        opacity: 0.2;
        z-index: -1;
    }
    62.5% {
        transform: translate(-50%, -50%) translate3d(calc(-0.707 * var(--obs-sun-x)), calc(-0.707 * var(--obs-sun-y)), 0);
        opacity: 0.2;
        z-index: -1;
    }
    75% {
        transform: translate(-50%, -50%) translate3d(0, calc(-1 * var(--obs-sun-y)), 0);
        opacity: 0.15;
        z-index: -1;
    }
    87.5% {
        transform: translate(-50%, -50%) translate3d(calc(var(--obs-sun-x) * 0.707), calc(-0.707 * var(--obs-sun-y)), 0);
        opacity: 0.2;
        z-index: -1;
    }
    95% {
        transform: translate(-50%, -50%) translate3d(calc(0.95 * var(--obs-sun-x)), calc(-0.3 * var(--obs-sun-y)), 0);
        opacity: 0.5;
        z-index: -1;
    }
    100% {
        transform: translate(-50%, -50%) translate3d(var(--obs-sun-x), 0, 0);
        opacity: 0.65;
        z-index: 2;
    }
}

.obs-earth {
    position: absolute;
    top: 58% !important; /* Centered visually on the letters to perfectly loop all around the title */
    left: 50% !important;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--axm-tertiary) !important; /* All same elegant brand tertiary color! */
    box-shadow: 0 0 4px var(--axm-tertiary) !important;
    will-change: transform, opacity;
    z-index: 2; /* Sits in front when passing in front */
    animation: obs-earth-3d var(--obs-dur-earth) linear infinite;
}

@keyframes obs-earth-3d {
    0% {
        transform: translate(-50%, -50%) translate3d(var(--obs-3d-x), 0, 0);
        opacity: 0.55;
        z-index: 2;
    }
    12.5% {
        transform: translate(-50%, -50%) translate3d(calc(var(--obs-3d-x) * 0.707), calc(var(--obs-3d-y) * 0.707), 0);
        opacity: 0.55;
        z-index: 2;
    }
    25% {
        transform: translate(-50%, -50%) translate3d(0, var(--obs-3d-y), 0);
        opacity: 0.55;
        z-index: 2;
    }
    37.5% {
        transform: translate(-50%, -50%) translate3d(calc(-0.707 * var(--obs-3d-x)), calc(var(--obs-3d-y) * 0.707), 0);
        opacity: 0.55;
        z-index: 2;
    }
    45% {
        transform: translate(-50%, -50%) translate3d(calc(-0.95 * var(--obs-3d-x)), calc(0.3 * var(--obs-3d-y)), 0);
        opacity: 0.45;
        z-index: 2;
    }
    50% {
        transform: translate(-50%, -50%) translate3d(calc(-1 * var(--obs-3d-x)), 0, 0);
        opacity: 0.2;
        z-index: -1;
    }
    62.5% {
        transform: translate(-50%, -50%) translate3d(calc(-0.707 * var(--obs-3d-x)), calc(-0.707 * var(--obs-3d-y)), 0);
        opacity: 0.15;
        z-index: -1;
    }
    75% {
        transform: translate(-50%, -50%) translate3d(0, calc(-1 * var(--obs-3d-y)), 0);
        opacity: 0.12;
        z-index: -1;
    }
    87.5% {
        transform: translate(-50%, -50%) translate3d(calc(var(--obs-3d-x) * 0.707), calc(-0.707 * var(--obs-3d-y)), 0);
        opacity: 0.15;
        z-index: -1;
    }
    95% {
        transform: translate(-50%, -50%) translate3d(calc(0.95 * var(--obs-3d-x)), calc(-0.3 * var(--obs-3d-y)), 0);
        opacity: 0.45;
        z-index: -1;
    }
    100% {
        transform: translate(-50%, -50%) translate3d(var(--obs-3d-x), 0, 0);
        opacity: 0.55;
        z-index: 2;
    }
}

.obs-moon {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2.5px;
    height: 2.5px;
    border-radius: 50%;
    background: var(--axm-tertiary) !important; /* All same elegant brand tertiary color! */
    box-shadow: 0 0 3px var(--axm-tertiary) !important;
    will-change: transform, opacity;
    z-index: 3; /* Sits in front of Earth when passing in front */
    animation: obs-moon-3d var(--obs-dur-moon) linear infinite;
}

@keyframes obs-moon-3d {
    0% {
        transform: translate(-50%, -50%) translate3d(12px, 0, 0);
        opacity: 0.5;
        z-index: 3;
    }
    12.5% {
        transform: translate(-50%, -50%) translate3d(calc(12px * 0.707), calc(5px * 0.707), 0);
        opacity: 0.5;
        z-index: 3;
    }
    25% {
        transform: translate(-50%, -50%) translate3d(0, 5px, 0);
        opacity: 0.5;
        z-index: 3;
    }
    37.5% {
        transform: translate(-50%, -50%) translate3d(calc(-0.707 * 12px), calc(5px * 0.707), 0);
        opacity: 0.5;
        z-index: 3;
    }
    45% {
        transform: translate(-50%, -50%) translate3d(calc(-0.95 * 12px), calc(0.3 * 5px), 0);
        opacity: 0.4;
        z-index: 3;
    }
    50% {
        transform: translate(-50%, -50%) translate3d(-12px, 0, 0);
        opacity: 0.1;
        z-index: -1;
    }
    62.5% {
        transform: translate(-50%, -50%) translate3d(calc(-0.707 * 12px), calc(-0.707 * 5px), 0);
        opacity: 0.1;
        z-index: -1;
    }
    75% {
        transform: translate(-50%, -50%) translate3d(0, -5px, 0);
        opacity: 0.08;
        z-index: -1;
    }
    87.5% {
        transform: translate(-50%, -50%) translate3d(calc(12px * 0.707), calc(-0.707 * 5px), 0);
        opacity: 0.1;
        z-index: -1;
    }
    95% {
        transform: translate(-50%, -50%) translate3d(calc(0.95 * 12px), calc(-0.3 * 5px), 0);
        opacity: 0.4;
        z-index: -1;
    }
    100% {
        transform: translate(-50%, -50%) translate3d(12px, 0, 0);
        opacity: 0.5;
        z-index: 3;
    }
}

/* Letter wave — signal ripple through "Observer" with individual glow */
.obs-word {
    color: var(--axm-primary) !important;
    display: inline-block;
}

.obs-l {
    display: inline-block;
    will-change: transform;
    animation: obs-wave var(--obs-dur) ease-in-out infinite;
}

.obs-l:nth-child(1) { animation-delay: 0.00s }
.obs-l:nth-child(2) { animation-delay: 0.07s }
.obs-l:nth-child(3) { animation-delay: 0.14s }
.obs-l:nth-child(4) { animation-delay: 0.21s }
.obs-l:nth-child(5) { animation-delay: 0.28s }
.obs-l:nth-child(6) { animation-delay: 0.35s }
.obs-l:nth-child(7) { animation-delay: 0.42s }
.obs-l:nth-child(8) { animation-delay: 0.49s }

@keyframes obs-wave {
    0%, 15%  { transform: translateY(0); text-shadow: none; }
    22%      { transform: translateY(-5px); text-shadow: 0 0 8px color-mix(in srgb, var(--axm-primary) 60%, transparent); }
    29%      { transform: translateY(0); text-shadow: none; }
    100%     { transform: translateY(0); text-shadow: none; }
}

/* 's — breathes like a rhythm between the words, with explicit space */
.obs-apos {
    display: inline-block;
    color: var(--axm-primary) !important;
    margin-right: 0.35em !important; /* Elegant visual gap between Observer's and Log */
    margin-left: 0.02em !important;
    will-change: opacity, transform, letter-spacing;
    animation: obs-breathe var(--obs-dur) ease-in-out infinite;
}

@keyframes obs-breathe {
    0%, 100% { opacity: 1; transform: scale(1); letter-spacing: normal; }
    50%      { opacity: 0.35; transform: scale(0.95); letter-spacing: 0.04em; }
}

/* Log — double-blinks like a data readout recording, featuring a terminal blinking cursor */
.obs-log {
    display: inline-block;
    color: var(--axm-primary) !important;
    font-weight: 800;
    will-change: opacity, transform;
    animation: obs-readout var(--obs-dur) ease-in-out infinite;
    position: relative;
}

.obs-log::after {
    content: '_';
    display: inline-block;
    color: var(--axm-primary) !important;
    animation: obs-cursor 1s step-end infinite;
    margin-left: 3px;
    vertical-align: baseline;
    font-weight: 800;
}

@keyframes obs-cursor {
    from, to { opacity: 1; text-shadow: 0 0 6px var(--axm-primary); }
    50% { opacity: 0; text-shadow: none; }
}

@keyframes obs-readout {
    0%, 20%  { opacity: 1; transform: scale(1); text-shadow: 0 0 4px color-mix(in srgb, var(--axm-primary) 30%, transparent); }
    28%      { opacity: 0.25; transform: scale(0.98); text-shadow: none; }
    36%      { opacity: 1; transform: scale(1.02); text-shadow: 0 0 8px color-mix(in srgb, var(--axm-primary) 50%, transparent); }
    52%      { opacity: 1; transform: scale(1); }
    60%      { opacity: 0.25; transform: scale(0.98); text-shadow: none; }
    68%      { opacity: 1; transform: scale(1.02); text-shadow: 0 0 8px color-mix(in srgb, var(--axm-primary) 50%, transparent); }
    100%     { opacity: 1; transform: scale(1); text-shadow: 0 0 4px color-mix(in srgb, var(--axm-primary) 30%, transparent); }
}

/* Accessibility — honour reduced-motion setting */
@media (prefers-reduced-motion: reduce) {
    .axm-nav__site-name::after,
    .axm-nav__site-name::before,
    .obs-l, .obs-apos, .obs-log {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
        text-shadow: none !important;
    }
    .obs-log::after {
        display: none !important;
    }
    .obs-system {
        display: none !important; /* Hide orbital system completely on reduced motion */
    }
}

/* ── Helper utilities for mobile/desktop/extra-small toggle ── */
.obs-mobile-only,
.obs-xs-only {
    display: none !important;
}

@media (max-width: 768px) {
    .obs-desktop-only {
        display: none !important;
    }
    .obs-mobile-only {
        display: inline-flex !important;
    }
}

@media (max-width: 480px) {
    .obs-xs-hidden {
        display: none !important;
    }
    .obs-xs-only {
        display: inline-flex !important;
    }
}

/* ── Mobile Layout Adjustments (Strictly Fit Screen) ─── */
@media (max-width: 768px) {
    .axm-nav__inner {
        padding: 0 0.75rem;
        gap: 0.375rem;
    }

    .axm-nav__brand {
        font-size: 1.05rem;
        flex-shrink: 0;
        min-width: 0;
        overflow: visible;
        text-overflow: clip;
        white-space: nowrap;
        gap: 0.35rem !important;
        /* Tighten gap between logo and text */
    }

    .axm-nav__brand-text {
        min-width: 0;
        overflow: visible;
        text-overflow: clip;
        white-space: nowrap;
    }

    .axm-nav__site-name {
        font-size: 1.05rem !important;
        display: block;
        overflow: visible;
        text-overflow: clip;
        white-space: nowrap;
    }

    .axm-nav__tagline {
        display: none !important;
    }

    .axm-nav__actions {
        gap: 0.35rem;
        flex-shrink: 0;
        align-items: center;
    }

    .axm-icon-btn {
        width: 2.25rem;
        height: 2.25rem;
        flex-shrink: 0;
    }

    .axm-account-btn {
        width: 2.25rem !important;
        height: 2.25rem !important;
        flex-shrink: 0;
    }

    /* Show notifications dropdown button on tablet and large mobiles */
    .axm-notifications {
        display: inline-flex !important;
    }

    /* Show compact text Sign-In button on tablet and large mobiles */
    .axm-nav__actions .axm-btn-primary {
        display: inline-flex !important;
        padding: 0.45rem 0.75rem !important;
        font-size: 0.8125rem !important;
        border-radius: var(--r-md) !important;
        gap: 0.35rem !important;
        height: 2.25rem !important;
        align-items: center !important;
        box-shadow: var(--neo-raised) !important;
        flex-shrink: 0;
    }

    /* Hide the redundant search icon in the top navbar on mobile (as search is in bottom navbar) */
    .axm-nav__search-mobile {
        display: none !important;
    }

    /* Position notification dropdown fixed to screen size to prevent viewport overflow */
    .axm-notifications__menu {
        position: fixed !important;
        top: 5rem !important;
        left: 1rem !important;
        right: 1rem !important;
        width: auto !important;
        max-width: none !important;
        box-shadow: var(--neo-float) !important;
    }
}

/* ── Compact Extra Small Mobile Viewport Layout Adjustments (Strictly under 480px width) ─── */
@media (max-width: 480px) {
    /* Hide the standalone notifications button on extra small devices */
    .axm-notifications {
        display: none !important;
    }

    /* Enable relative wrapper for absolute badge */
    .axm-nav__account {
        position: relative !important;
    }

    /* Place the notification badge on the outer surface of axm-nav__account (bypassing button overflow clip) */
    .axm-nav__account .axm-notifications__badge {
        position: absolute !important;
        top: -0.15rem !important;
        right: -0.15rem !important;
        z-index: 10 !important;
        box-shadow: 0 0 0 2px var(--axm-surface) !important; /* Premium circular cutout outline */
        pointer-events: none; /* Let touches pass through directly to the avatar button beneath */
    }

    /* Make Sign-In button highly concise (icon-only square) on extra small devices */
    .axm-nav__actions .axm-btn-primary {
        display: inline-flex !important;
        width: 2.25rem !important;
        height: 2.25rem !important;
        padding: 0 !important;
        justify-content: center !important;
        align-items: center !important;
        border-radius: var(--r-lg) !important;
    }

    /* Inline badge styling inside the account dropdown menu item */
    .axm-notifications__badge-inline {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-left: auto;
        min-width: 1.25rem;
        height: 1.25rem;
        padding: 0 0.35rem;
        border-radius: var(--r-full);
        background: var(--axm-error);
        color: var(--axm-on-error);
        font-size: 0.7rem;
        font-weight: 800;
        line-height: 1;
    }

    /* Collapsible Notifications Toggle button inside account dropdown */
    .axm-dropdown-notifications-toggle {
        display: flex !important;
        align-items: center !important;
        width: 100% !important;
        padding: 0.75rem 1rem !important;
        background: none !important;
        border: none !important;
        color: var(--axm-on-surface-variant) !important;
        font-family: inherit !important;
        font-size: 0.875rem !important;
        font-weight: 500 !important;
        text-align: left !important;
        cursor: pointer !important;
        border-radius: var(--r-md) !important;
        transition: all var(--t-fast) !important;
        gap: 0.75rem !important;
        box-shadow: none !important;
    }

    .axm-dropdown-notifications-toggle:hover {
        background: var(--axm-surface-container) !important;
        color: var(--axm-primary) !important;
        box-shadow: var(--neo-pressed) !important;
    }

    .axm-dropdown-notifications-toggle .material-symbols-outlined {
        font-size: 1.125rem !important;
    }

    .axm-dropdown-notifications-toggle .axm-dropdown-notifications-title {
        flex-grow: 1 !important;
    }

    .axm-notifications-chevron {
        margin-left: auto !important;
        transition: transform var(--t-base) !important;
    }

    .axm-dropdown-notifications-toggle[aria-expanded="true"] .axm-notifications-chevron {
        transform: rotate(180deg) !important;
    }

    /* Collapsible Notifications List Container */
    .axm-dropdown-notifications-list[hidden] {
        display: none !important;
    }

    .axm-dropdown-notifications-list {
        max-height: 14rem !important;
        overflow-y: auto !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 0.35rem !important;
        margin: 0.25rem 0.5rem 0.5rem !important;
        padding: 0.35rem !important;
        border-radius: var(--r-md) !important;
        background: var(--axm-surface-container-low, var(--axm-surface-container)) !important;
        box-shadow: var(--neo-pressed) !important;
        scrollbar-width: thin !important;
    }

    /* Collapsible Notification Item */
    .axm-dropdown-notifications-item {
        display: flex !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
        padding: 0.5rem !important;
        border-radius: var(--r-sm) !important;
        text-decoration: none !important;
        color: var(--axm-on-surface-variant) !important;
        font-size: 0.75rem !important;
        line-height: 1.3 !important;
        transition: all var(--t-fast) !important;
        border-left: 3px solid transparent !important;
    }

    .axm-dropdown-notifications-item:hover {
        background: var(--axm-surface-container-high, var(--axm-surface)) !important;
        color: var(--axm-primary) !important;
        box-shadow: var(--neo-raised) !important;
    }

    .axm-dropdown-notifications-item--unread {
        background: var(--axm-surface-container-high, var(--axm-surface)) !important;
        border-left-color: var(--axm-primary) !important;
    }

    .axm-dropdown-notifications-item .material-symbols-outlined {
        font-size: 1rem !important;
        color: var(--axm-primary) !important;
        margin-top: 0.1rem !important;
        flex-shrink: 0 !important;
    }

    .axm-dropdown-notifications-item-text {
        display: flex !important;
        flex-direction: column !important;
        min-width: 0 !important;
    }

    .axm-dropdown-notifications-item-text strong {
        color: var(--axm-on-surface) !important;
        font-size: 0.785rem !important;
        font-weight: 600 !important;
        display: block !important;
        white-space: normal !important;
        word-break: break-word !important;
    }

    .axm-dropdown-notifications-item-text small {
        color: var(--axm-on-surface-variant) !important;
        display: block !important;
        font-size: 0.7rem !important;
        margin-top: 0.15rem !important;
        white-space: normal !important;
        word-break: break-word !important;
    }

    .axm-dropdown-notifications-empty {
        margin: 0 !important;
        padding: 0.75rem 0.5rem !important;
        color: var(--axm-on-surface-variant) !important;
        font-size: 0.75rem !important;
        text-align: center !important;
    }

    /* Constrain the logo image height and width below the 768px mobile threshold to leave space for text */
    .axm-nav__brand--logo img.custom-logo {
        height: 24px !important;
        width: 24px !important;
        aspect-ratio: 1 / 1;
        max-width: 90px !important;
    }
}

@media (max-width: 782px) {
    body.admin-bar .axm-nav,
    body.admin-bar .axm-reading-topbar {
        top: 0 !important;
    }
}

@media (max-width: 480px) {
    .axm-bottom-nav {
        padding: 0 0.5rem;
    }

    .axm-bottom-nav__item {
        padding: 0.5rem 0.25rem;
        min-width: 3.5rem;
    }

    /* ── Primary Header Extra-Small Viewports (Under 480px) ── */
    :root {
        --obs-3d-x: 35px !important;  /* Half distance to completely fit orbit on screen */
        --obs-3d-y: 10px !important;
        --obs-sun-x: 28px !important;
        --obs-sun-y: 6px !important;
    }

    .axm-nav__inner {
        padding: 0 0.45rem !important;
        gap: 0.2rem !important;
        height: 4.5rem !important; /* Slightly more compact header bar */
    }

    /* Reduce Hamburger, Actions, and Account buttons to 1.875rem (30px) */
    .axm-hamburger,
    .axm-nav__actions .axm-icon-btn,
    .axm-nav__actions .axm-account-btn {
        width: 1.875rem !important;
        height: 1.875rem !important;
        min-width: 1.875rem !important;
    }

    .axm-hamburger .material-symbols-outlined,
    .axm-nav__actions .axm-icon-btn .material-symbols-outlined {
        font-size: 1.05rem !important;
    }

    .axm-nav__actions .axm-account-btn__avatar {
        width: 1.875rem !important;
        height: 1.875rem !important;
    }

    /* Reduce logo size under 480px to save critical horizontal space */
    .axm-nav__brand--logo img.custom-logo {
        height: 18px !important;
        width: 18px !important;
    }

    /* Reduce brand brand-text gap and font-size */
    .axm-nav__brand {
        gap: 0.2rem !important;
    }

    .axm-nav__site-name {
        font-size: 0.825rem !important;
        letter-spacing: -0.03em !important;
    }
}

/* If your logo is full colour (not black/white), add class="axm-logo-colour"
   to the logo image in WP Admin → Customise → Site Identity
   and keep this rule to skip inversion:
html.dark .axm-logo-colour { filter: none; }
*/