/* --- Foundational Styles --- */
:root {
    --bg-primary: #05050A;
    /* Deeper space black */
    --bg-secondary: #0A0A10;
    --glass-bg: rgba(10, 10, 15, 0.6);
    /* Darker translucent glass tint */
    --glass-bg-nav: rgba(10, 10, 16, 0.95);
    --glass-border: rgba(255, 255, 255, 0.15);
    /* Subtly brighter border */
    --text-primary: #ffffff;
    --text-secondary: #c0c0c8;
    --text-muted: #80808a;
    --accent-orange: #f59e0b;
    --accent-purple: #9d4edd;
    --accent-cyan: #00f5ff;
    /* Neon cyan */
    --gradient-primary: linear-gradient(135deg, #9d4edd 0%, #00f5ff 100%);
    --radius-xl: 20px;
    --xw-site-nav-height: 64px;
    --site-nav-height: var(--xw-site-nav-height);

    /* PWA Padding Adjustments - Default to 0, overridden for standalone/PWA */
    --pwa-padding-top: 0px;

    /* Premium Loader Variables */
    --loader-duration: 2s;
    --loader-path-length: 157px;
}

/* --- Global & Body Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Atmospheric fill lives on html so Safari overscroll / dynamic toolbar
   gaps still show the coloured background instead of solid black. */
html {
    min-height: 100%;
    min-height: -webkit-fill-available;
    min-height: 100dvh;
    background-color: var(--bg-primary);
    background-image:
        radial-gradient(circle at 20% 30%, rgba(157, 78, 221, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(0, 245, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(10, 10, 25, 0.8) 0%, var(--bg-primary) 100%);
}

body {
    font-family: 'Outfit', 'Inter', sans-serif;
    background: transparent;
    color: var(--text-primary);
    padding: 0;
    position: relative;
    overflow-x: hidden;
    min-height: 100%;
    min-height: -webkit-fill-available;
    min-height: 100dvh;
}

/* Class added by JS to prevent scrolling when the mobile menu is open or loading */
body.nav-open,
body.loading {
    overflow: hidden;
}

/* --- Background Decorations --- */
.background-overlay,
.floating-shapes,
#particle-canvas {
    position: fixed;
    inset: 0;
    width: auto;
    height: auto;
    min-height: 100%;
    min-height: -webkit-fill-available;
    min-height: 100dvh;
    pointer-events: none;
    overflow: hidden;
}

.background-overlay,
.floating-shapes {
    z-index: -1;
}

#particle-canvas {
    z-index: 0;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: drift 20s infinite alternate ease-in-out;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--accent-purple);
    top: 10%;
    left: 10%;
    animation-duration: 25s;
}

.shape-2 {
    width: 500px;
    height: 500px;
    background: var(--accent-cyan);
    top: 60%;
    right: 5%;
    animation-duration: 30s;
    animation-direction: alternate-reverse;
}

.shape-3 {
    width: 350px;
    height: 350px;
    background: #3a0ca3;
    /* Deep rich blue/purple */
    top: 40%;
    left: 40%;
    animation-duration: 22s;
    opacity: 0.3;
}

@keyframes drift {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(50px, 30px) scale(1.1);
    }

    100% {
        transform: translate(-30px, -50px) scale(0.95);
    }
}

/* --- Main Layout & Card Styles --- */
.app-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1200px;
    /* <<< CHANGED: Increased from 800px to allow wider grid */
    margin: 1.5rem auto 0;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.glass-card {
    background: linear-gradient(135deg, rgba(15, 15, 25, 0.8), rgba(10, 10, 15, 0.5));
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    /* Catch the 'light' from above */
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, border-color 0.4s ease;
}

.glass-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6), 0 0 25px rgba(0, 245, 255, 0.15);
    /* Antigravity lift & ambient glow */
    border-color: rgba(255, 255, 255, 0.3);
}

a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--text-primary);
}

/* --- Shared site navigation --- */
#main-nav-placeholder {
    position: sticky;
    top: 0;
    z-index: 10000;
    min-height: calc(3.75rem + env(safe-area-inset-top, 0px));
    isolation: isolate;
}

#main-nav-placeholder.nav-is-ready {
    min-height: 0;
}

.xw-main-nav-header {
    position: relative;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: calc(0.4rem + env(safe-area-inset-top, 0px)) max(1rem, env(safe-area-inset-right, 0px)) 0.4rem max(1rem, env(safe-area-inset-left, 0px));
    box-sizing: border-box;
    background: rgba(8, 8, 14, 0.94);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.28);
    color: var(--text-primary);
}

.xw-main-nav-header .header-content {
    display: flex;
    align-items: center;
    gap: clamp(0.75rem, 2vw, 2rem);
    width: 100%;
    max-width: 1480px;
    min-height: 3rem;
    margin: 0 auto;
}

.xw-main-nav-header .logo {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.65rem;
    min-height: 44px;
    padding: 0.25rem;
    border-radius: 12px;
    color: var(--text-primary);
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: clamp(1.05rem, 1.5vw, 1.25rem);
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    text-shadow: none !important;
    box-shadow: none !important;
}

.xw-main-nav-header .logo img {
    display: block;
    width: 2rem;
    height: 2rem;
    margin: 0;
    object-fit: contain;
    filter: none !important;
    box-shadow: none !important;
}

.main-nav {
    flex: 1 1 auto;
    min-width: 0;
}

.nav-links,
.nav-submenu {
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: clamp(0.1rem, 0.55vw, 0.55rem);
}

.nav-top-level {
    position: static;
    flex: 0 0 auto;
}

.nav-top-link,
.nav-disclosure {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    min-height: 44px;
    margin: 0;
    padding: 0.55rem clamp(0.48rem, 0.75vw, 0.78rem);
    overflow: visible;
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    box-shadow: none;
    color: var(--text-secondary);
    font: 600 clamp(0.78rem, 0.92vw, 0.92rem)/1 'Outfit', 'Inter', sans-serif;
    letter-spacing: 0.01em;
    text-decoration: none;
    text-transform: none;
    white-space: nowrap;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.nav-top-link::before,
.nav-top-link::after,
.nav-disclosure::before,
.nav-disclosure::after,
.nav-toggle::before,
.nav-toggle::after,
.nav-search-trigger::before,
.nav-search-trigger::after {
    content: none;
    display: none;
}

.nav-top-link:active,
.nav-disclosure:active,
.nav-toggle:active,
.nav-search-trigger:active {
    transform: none;
}

.nav-top-link:hover,
.nav-disclosure:hover,
.nav-has-dropdown.is-open > .nav-disclosure {
    color: var(--text-primary);
    border-color: rgba(0, 245, 255, 0.18);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: none;
}

.nav-top-link.active,
.nav-disclosure.has-active-page,
.nav-has-dropdown.is-open > .nav-disclosure.has-active-page {
    color: var(--text-primary);
    border-color: rgba(0, 245, 255, 0.55);
    background:
        linear-gradient(135deg, rgba(0, 245, 255, 0.14), rgba(157, 78, 221, 0.1));
    box-shadow: 0 0 18px rgba(0, 245, 255, 0.16);
}

.nav-top-link.active:hover,
.nav-disclosure.has-active-page:hover,
.nav-has-dropdown.is-open > .nav-disclosure.has-active-page:hover {
    border-color: rgba(0, 245, 255, 0.72);
    background:
        linear-gradient(135deg, rgba(0, 245, 255, 0.18), rgba(157, 78, 221, 0.14));
    box-shadow: 0 0 22px rgba(0, 245, 255, 0.22);
}

.nav-top-link:focus-visible,
.nav-disclosure:focus-visible,
.nav-toggle:focus-visible,
.nav-dropdown a:focus-visible,
.xw-main-nav-header .logo:focus-visible {
    outline: 3px solid rgba(0, 245, 255, 0.55);
    outline-offset: 2px;
}

.nav-chevron {
    width: 0.85rem;
    height: 0.85rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 180ms ease;
}

.nav-disclosure[aria-expanded="true"] .nav-chevron {
    transform: rotate(180deg);
}

.nav-dropdown[hidden] {
    display: none !important;
}

.nav-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 50%;
    z-index: 10003;
    width: min(46rem, calc(100vw - 2rem));
    max-height: calc(100dvh - var(--xw-site-nav-height) - 1.5rem);
    padding: 1rem;
    overflow: auto;
    overscroll-behavior: contain;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 20px;
    background: rgba(10, 10, 17, 0.98);
    -webkit-backdrop-filter: blur(24px) saturate(145%);
    backdrop-filter: blur(24px) saturate(145%);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.58);
    transform: translateX(-50%);
    scrollbar-gutter: stable;
}

.nav-dropdown-wide {
    width: min(66rem, calc(100vw - 2rem));
}

.nav-dropdown-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    position: sticky;
    top: -1rem;
    z-index: 3;
    margin: -1rem -1rem 0.8rem;
    padding: 1rem 1rem 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(10, 10, 17, 0.98);
}

.nav-dropdown-tools {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-left: auto;
}

.nav-dropdown-header > div {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.nav-eyebrow {
    color: var(--accent-cyan);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.nav-dropdown-title {
    color: var(--text-primary);
    font-size: 1.12rem;
    font-weight: 700;
}

.nav-view-all {
    flex: 0 0 auto;
    padding: 0.45rem 0.7rem;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.nav-view-all:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.07);
}

.nav-submenu {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.3rem;
}

.nav-dropdown-wide .nav-submenu {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.nav-submenu a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.55rem;
    min-height: 42px;
    padding: 0.55rem 0.7rem;
    border: 1px solid transparent;
    border-radius: 11px;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.25;
    text-decoration: none;
    transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.nav-item-icon {
    flex: 0 0 auto;
    width: 1.15rem;
    height: 1.15rem;
    object-fit: contain;
    border-radius: 4px;
}

.nav-item-icon-emoji {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    line-height: 1;
}

svg.nav-item-icon {
    color: currentColor;
}

.nav-item-label {
    flex: 1 1 auto;
    min-width: 0;
}

.nav-view-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.12rem;
    padding: 0.15rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
}

.nav-view-toggle button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 34px;
    margin: 0;
    padding: 0.3rem 0.6rem;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-secondary);
    font: 600 0.75rem/1 'Outfit', 'Inter', sans-serif;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.nav-view-toggle button svg {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-view-toggle button:hover,
.nav-view-toggle button[aria-pressed="true"] {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.nav-view-toggle button[aria-pressed="true"] {
    background: linear-gradient(135deg, rgba(0, 245, 255, 0.2), rgba(157, 78, 221, 0.18));
    box-shadow: inset 0 0 0 1px rgba(0, 245, 255, 0.28);
}

.nav-view-toggle button:focus-visible {
    outline: 3px solid rgba(0, 245, 255, 0.55);
    outline-offset: 2px;
}

[data-site-header][data-nav-view="icons"] .nav-submenu,
[data-site-header][data-nav-view="icons"] .nav-dropdown-wide .nav-submenu {
    grid-template-columns: repeat(auto-fill, minmax(5.6rem, 1fr));
    gap: 0.4rem;
}

[data-site-header][data-nav-view="icons"] .nav-submenu a {
    position: relative;
    container-type: inline-size;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    aspect-ratio: 1;
    min-height: 5.6rem;
    padding: 0.9rem;
    overflow: hidden;
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.045);
}

[data-site-header][data-nav-view="icons"] .nav-submenu a:focus-visible {
    outline-offset: -3px;
}

[data-site-header][data-nav-view="icons"] .nav-item-icon {
    width: 100%;
    height: 100%;
    flex: 1 1 auto;
    min-height: 0;
    border-radius: 0;
    transform: translate(var(--icon-shift-x, 0%), var(--icon-shift-y, 0%)) scale(var(--icon-scale, 1));
    transform-origin: center;
}

[data-site-header][data-nav-view="icons"] .nav-item-icon-emoji {
    align-self: center;
    width: auto;
    height: auto;
    flex: 0 0 auto;
    font-size: 82cqi;
    line-height: 1;
    transform: none;
}

[data-site-header][data-nav-view="icons"] .nav-submenu .nav-item-label,
[data-site-header][data-nav-view="icons"] .nav-submenu a[data-external] > span[aria-hidden="true"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (hover: hover) and (pointer: fine) and (min-width: 1101px) {
    [data-site-header][data-nav-view="icons"] .nav-submenu li {
        position: relative;
        z-index: 0;
    }

    [data-site-header][data-nav-view="icons"] .nav-submenu li:hover,
    [data-site-header][data-nav-view="icons"] .nav-submenu li:focus-within {
        z-index: 8;
    }

    [data-site-header][data-nav-view="icons"] .nav-submenu a:hover,
    [data-site-header][data-nav-view="icons"] .nav-submenu a:focus-visible {
        z-index: 8;
    }

    [data-site-header][data-nav-view="icons"] .nav-submenu a:hover .nav-item-label,
    [data-site-header][data-nav-view="icons"] .nav-submenu a:focus-visible .nav-item-label {
        position: absolute;
        inset: 0.3rem;
        display: flex;
        align-items: center;
        justify-content: center;
        width: auto;
        height: auto;
        margin: 0;
        padding: 0.35rem;
        overflow: visible;
        clip: auto;
        transform: none;
        white-space: normal;
        text-align: center;
        color: var(--text-primary);
        font-size: 0.78rem;
        font-weight: 650;
        line-height: 1.25;
        background: rgba(12, 12, 20, 0.94);
        border: 1px solid rgba(255, 255, 255, 0.16);
        border-radius: 10px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
        z-index: 9;
        pointer-events: none;
    }
}

.nav-submenu a[data-external] > span[aria-hidden="true"] {
    flex: 0 0 auto;
    margin-left: auto;
    opacity: 0.65;
    font-size: 0.8rem;
}

.nav-submenu a:hover {
    color: var(--text-primary);
    border-color: rgba(0, 245, 255, 0.16);
    background: rgba(255, 255, 255, 0.07);
}

.nav-submenu a.active {
    color: var(--text-primary);
    border-color: rgba(0, 245, 255, 0.5);
    background:
        linear-gradient(135deg, rgba(0, 245, 255, 0.14), rgba(157, 78, 221, 0.1));
    box-shadow: 0 0 16px rgba(0, 245, 255, 0.14);
}

.nav-submenu a.active:hover {
    border-color: rgba(0, 245, 255, 0.68);
    background:
        linear-gradient(135deg, rgba(0, 245, 255, 0.18), rgba(157, 78, 221, 0.14));
}

.nav-panel-heading,
.nav-toggle,
.nav-backdrop {
    display: none;
}

.nav-header-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.4rem;
    margin-left: 0.25rem;
}

.xw-page-order {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    color: var(--text-muted);
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
}

.xw-page-order-select {
    appearance: none;
    -webkit-appearance: none;
    min-height: 36px;
    margin: 0;
    padding: 0.28rem 1.55rem 0.28rem 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.06);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23c0c0c8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.45rem center;
    background-size: 0.7rem;
    color: var(--text-primary);
    color-scheme: dark;
    font: 600 0.8rem/1 'Outfit', 'Inter', sans-serif;
    letter-spacing: 0.01em;
    text-transform: none;
    cursor: pointer;
}

.xw-page-order-select:hover {
    border-color: rgba(0, 245, 255, 0.35);
    background-color: rgba(0, 245, 255, 0.08);
}

.xw-page-order-select:focus-visible {
    outline: 3px solid rgba(0, 245, 255, 0.55);
    outline-offset: 2px;
}

.xw-page-order-panel {
    display: none;
}

.nav-search-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 44px;
    padding: 0.55rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font: 600 0.88rem/1 'Outfit', 'Inter', sans-serif;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: color 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.nav-search-trigger:hover {
    color: var(--text-primary);
    border-color: rgba(0, 245, 255, 0.35);
    background: rgba(0, 245, 255, 0.08);
    box-shadow: 0 0 16px rgba(0, 245, 255, 0.12);
}

.nav-search-trigger:focus-visible {
    outline: 3px solid rgba(0, 245, 255, 0.55);
    outline-offset: 2px;
}

.nav-search-icon {
    width: 1.05rem;
    height: 1.05rem;
    flex: 0 0 auto;
}

.nav-fallback .header-content {
    justify-content: space-between;
}

.nav-fallback nav {
    display: flex;
    gap: 0.4rem;
}

.nav-fallback nav a {
    padding: 0.65rem;
    border-radius: 10px;
    color: var(--text-secondary);
    font-weight: 600;
}

.nav-fallback nav a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.07);
}

/* --- Page Content Specific Styles --- */
.hero-card {
    text-align: center;
}

.hero-card h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-card p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.hero-contact {
    margin-top: -0.75rem !important;
    margin-bottom: 1.5rem !important;
    font-size: 0.95rem;
    font-weight: 600;
}

.hero-contact a {
    color: var(--accent-cyan);
    text-decoration: underline;
    transition: opacity 0.3s;
}

.hero-contact a:hover {
    opacity: 0.8;
}

/* --- PROFILE PICTURE REVEAL ANIMATION (TIGHTENING CROP) --- */
.profile-picture-wrapper {
    /* INITIAL WINDOW SIZE - Controls the initial 'loose' crop */
    width: 600px;
    height: 600px;

    margin: 0 auto 1.5rem;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    /* Needed for the absolute image inside */
    display: flex;
    justify-content: center;
    align-items: center;
    border: 3px solid var(--glass-border);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);

    /* INITIAL VISIBILITY */
    opacity: 0;
    filter: blur(20px);
    -webkit-filter: blur(20px);
    /* iOS Safari Support */

    /* iOS FIX: Force hardware acceleration and fix overflow:hidden bug during transitions */
    transform: translateZ(0);
    -webkit-mask-image: -webkit-radial-gradient(white, black);

    /* ANIMATION DEFINITION */
    transition:
        filter 0.6s ease-out,
        -webkit-filter 1.2s ease-out,
        opacity 1.2s ease-out,
        width 1.8s cubic-bezier(0.16, 1, 0.3, 1) 1.2s,
        height 1.8s cubic-bezier(0.16, 1, 0.3, 1) 1.2s;
}

.profile-picture-wrapper.loaded {
    opacity: 1;
    filter: blur(0);
    -webkit-filter: blur(0);

    /* FINAL WINDOW SIZE - Controls the final display size on the page */
    width: 300px;
    height: 300px;
}

.profile-picture {
    /* FIXED IMAGE SIZE - Controls the constant magnification/scale of the image */
    width: 600px !important;
    height: 600px !important;

    object-fit: cover;
    flex-shrink: 0;
    /* No transitions or scale changes on the image itself to keep it constant */
}

/* --- END PROFILE PICTURE STYLES --- */

.page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* --- Top Section Grid (Profile + Featured App) --- */
.top-section-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    align-items: stretch;
    /* Make them same height */
}

/* Make sure the featured card takes up full height */
/* Make sure the featured card takes up full height */
/* UPDATED: This selector was too broad and affected the nested cards. 
   We only want this behavior if a page-card is a direct child of the grid (legacy support) 
   or we can just remove it and style specific instances. 
   For now, I'll restrict it to direct children or potential future uses. */
.top-section-grid>.page-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* Override any potential margins */
}

/* New Right Column Stack */
.hero-side-stack {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: 100%;
}

.hero-side-stack .page-card {
    /* To Do List card takes up natural space based on content */
    flex: 0 0 auto;
    /* Inherit grid display from .page-card */
}

/* Removed .hero-side-stack .page-card .page-icon override to use global 64px */

.hero-side-stack .page-card h3 {
    margin-bottom: 0;
    /* Align with global style */
}

.hero-side-stack .page-card p {
    font-size: 0.9rem;
}

/* About Card Styles */
.about-card {
    flex: 1;
    /* Takes up remaining vertical space */
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem;
    text-align: left;
}

.about-card-heading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.about-card-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.about-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    width: fit-content;
}

.about-card .tagline {
    font-style: italic;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 600;
}

.about-card .bio-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.about-card .bio-text strong {
    color: var(--text-primary);
}

.interests-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
    /* Push to bottom if space allows */
}

.tag {
    background: rgba(10, 10, 15, 0.4);
    border: 1px solid var(--glass-border);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.tag:hover {
    background: rgba(15, 15, 25, 0.6);
    color: var(--text-primary);
    border-color: var(--accent-cyan);
    transform: translateY(-2px);
}


.page-card {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, border-color 0.4s ease;
    text-align: left;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 0.5rem 1.5rem;
    align-items: center;
    padding: 1.5rem;
}

.page-card:hover {
    transform: translateY(-8px);
    /* Let antigravity hover take over mostly, but add purple border */
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6), 0 0 25px rgba(157, 78, 221, 0.25);
    border-color: var(--accent-purple);
}

.page-card h3 {
    margin-bottom: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
    grid-column: 2;
    grid-row: 1;
    align-self: end;
}

.page-card p {
    color: #ffffff;
    /* Pure white description */
    grid-column: 2;
    grid-row: 2;
    margin: 0;
    align-self: start;
}

.page-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 0;
    display: inline-block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    grid-column: 1;
    grid-row: 1 / -1;
}

.page-icon-emoji {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    line-height: 1;
}

.support-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
}

.support-card {
    padding: 1.25rem 1rem;
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.support-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6), 0 0 25px rgba(0, 245, 255, 0.2);
    border-color: var(--accent-cyan);
    color: var(--text-primary);
}

/* --- Contact Card --- */
.contact-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    margin-top: 2rem;
}

.contact-icon {
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.page-icon-link {
    object-fit: contain;
    filter: brightness(0) invert(1) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.contact-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    width: fit-content;
}

.contact-content p {
    color: var(--text-secondary);
    margin: 0;
}

.contact-content a {
    color: var(--accent-cyan);
    font-weight: 600;
    transition: color 0.3s ease;
}

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

/* --- Section Headers --- */
.section-title {
    font-size: 1.8rem;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    padding-left: 0.5rem;
    border-left: 4px solid var(--accent-purple);
    line-height: 1.2;
    scroll-margin-top: 5.25rem;
}

#contact,
#recent {
    scroll-margin-top: 5.25rem;
}

.recent-section[hidden],
.section-jump-link[hidden] {
    display: none !important;
}

.recent-pages-grid .page-card {
    border-color: rgba(0, 245, 255, 0.18);
    grid-template-rows: auto auto auto;
}

.recent-pages-grid .page-card p:not(.recent-meta) {
    grid-row: 2;
}

.recent-pages-grid .page-card .recent-meta {
    grid-column: 2;
    grid-row: 3;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
    align-self: start;
}

.recent-pages-grid .page-icon {
    grid-row: 1 / -1;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Sticky in-page section jump bar --- */
.section-jump-tools {
    display: flex;
    justify-content: flex-end;
}

.section-jump-tools .xw-page-order-select {
    min-height: 34px;
    background-color: rgba(8, 8, 14, 0.75);
}

.section-jump-bar {
    position: sticky;
    top: calc(var(--xw-site-nav-height, 0px) + 0.65rem);
    z-index: 90;
    margin: 0.15rem 0 0;
    padding: 0.55rem 0.65rem;
    background: linear-gradient(135deg, rgba(15, 15, 25, 0.92), rgba(10, 10, 15, 0.78));
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-top: 1px solid rgba(255, 255, 255, 0.22);
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-xl);
    box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.section-jump-search {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.section-jump-search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.7rem 2.4rem 0.7rem 0.95rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(8, 8, 14, 0.75);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.section-jump-search-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.section-jump-search-input:focus {
    border-color: rgba(0, 245, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(0, 245, 255, 0.12);
    background: rgba(8, 8, 14, 0.92);
}

.section-jump-search-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

.section-jump-search-clear {
    position: absolute;
    right: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.85rem;
    height: 1.85rem;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
}

.section-jump-search-clear:hover,
.section-jump-search-clear:focus-visible {
    background: rgba(0, 245, 255, 0.18);
    color: var(--text-primary);
    outline: none;
}

.section-jump-search-clear[hidden] {
    display: none !important;
}

.section-jump-search-status {
    margin: 0;
    padding: 0 0.15rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
}

.section-jump-search-status[hidden] {
    display: none !important;
}

.section-jump-search-status.is-empty {
    color: #ffb4a8;
}

body.is-page-searching .section-jump-bar {
    margin-bottom: 0.25rem;
    border-color: rgba(0, 245, 255, 0.35);
    box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 245, 255, 0.12);
}

.page-card.is-search-hidden,
.section-title.is-search-hidden,
.recent-section.is-search-hidden,
.top-section-grid.is-search-hidden,
.section-jump-link.is-search-hidden,
.page-grid.is-search-hidden {
    display: none !important;
}

body.is-page-searching .app-container {
    gap: 1rem;
}

.section-jump-bar-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 0.45rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0.05rem;
    -webkit-overflow-scrolling: touch;
}

.section-jump-bar-inner::-webkit-scrollbar {
    display: none;
}

.section-jump-link {
    flex: 0 0 auto;
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.45rem 0.9rem;
    position: relative;
    white-space: nowrap;
    cursor: pointer;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(10, 10, 15, 0.45);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.section-jump-link:hover,
.section-jump-link:focus-visible {
    color: var(--text-primary);
    background: rgba(15, 15, 25, 0.7);
    border-color: rgba(0, 245, 255, 0.45);
    transform: translateY(-1px);
    outline: none;
    box-shadow: 0 0 16px rgba(0, 245, 255, 0.12);
}

.section-jump-link:active {
    transform: translateY(0);
}

.section-jump-link.active {
    color: #041016;
    background: linear-gradient(135deg, rgba(157, 78, 221, 0.95), rgba(0, 245, 255, 0.92));
    border-color: transparent;
    box-shadow: 0 0 18px rgba(0, 245, 255, 0.28), 0 6px 16px rgba(0, 0, 0, 0.25);
}

.section-jump-link.active:hover,
.section-jump-link.active:focus-visible {
    color: #041016;
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: 0 0 22px rgba(0, 245, 255, 0.35), 0 8px 18px rgba(0, 0, 0, 0.28);
}

@media (max-width: 768px) {
    .section-jump-bar {
        top: calc(var(--xw-site-nav-height, 0px) + 0.45rem);
        padding: 0.45rem 0.5rem;
        border-radius: 16px;
        gap: 0.4rem;
    }

    .section-jump-tools .xw-page-order {
        width: 100%;
        justify-content: space-between;
    }

    .section-jump-tools .xw-page-order-select {
        flex: 1 1 auto;
        max-width: 12rem;
    }

    .section-jump-search-input {
        font-size: 1rem;
        padding: 0.75rem 2.4rem 0.75rem 0.9rem;
    }

    .section-jump-bar-inner {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-content: stretch;
        gap: 0.4rem;
        overflow: visible;
    }

    .section-jump-link {
        width: 100%;
        box-sizing: border-box;
        text-align: center;
        font-size: 0.82rem;
        padding: 0.45rem 0.55rem;
        border-radius: 12px;
        white-space: nowrap;
    }

    .section-jump-link[hidden] {
        display: none !important;
    }

    .section-title,
    #contact,
    #recent {
        scroll-margin-top: 12.5rem;
    }
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* --- Special Cards --- */
@keyframes purple-pulse {
    0% {
        box-shadow: 0 0 0 rgba(139, 92, 246, 0);
        border-color: var(--glass-border);
    }

    50% {
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
        border-color: var(--accent-purple);
    }

    100% {
        box-shadow: 0 0 0 rgba(139, 92, 246, 0);
        border-color: var(--glass-border);
    }
}

.special-akensile-card {
    animation: purple-pulse 3s infinite ease-in-out;
}

/* Ensure hover state overrides or combines nicely */
.special-akensile-card:hover {
    animation: none;
    /* Stop pulsing on hover to stick to the active hover state */
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.8);
    border-color: var(--accent-purple);
    transform: translateY(-5px);
}

/* --- Featured Pages Special Styling --- */
.best-pages-grid .page-card {
    position: relative;
    border-color: rgba(245, 158, 11, 0.18);
    background-clip: padding-box;
    z-index: 1;
}

/* Background of the card (Masking the center of the gradient) */
.best-pages-grid .page-card::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: var(--bg-primary);
    border-radius: inherit;
    z-index: -1;
    opacity: 0.9;
}

/* Gold border — quiet by default, glints one card at a time via JS */
.best-pages-grid .page-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    z-index: -2;
    background: linear-gradient(120deg,
            rgba(120, 80, 20, 0.55) 0%,
            rgba(180, 130, 40, 0.35) 35%,
            rgba(255, 215, 100, 0.15) 50%,
            rgba(180, 130, 40, 0.35) 65%,
            rgba(120, 80, 20, 0.55) 100%);
    border-radius: inherit;
    opacity: 0.55;
    transition: opacity 0.35s ease, filter 0.35s ease, inset 0.35s ease, background 0.35s ease;
}

.best-pages-grid .page-card.glinting::before {
    background: linear-gradient(115deg,
            #8a5a12 0%,
            #d4a017 18%,
            #ffe08a 36%,
            #fff6d0 50%,
            #ffe08a 64%,
            #d4a017 82%,
            #8a5a12 100%);
    background-size: 220% 220%;
    animation: featured-gold-glint 1.35s ease-in-out 1;
    opacity: 1;
    filter: blur(1px);
}

/* Hover is cyan/purple lift — distinct from the gold glint highlight */
.best-pages-grid .page-card:hover::before {
    opacity: 1;
    filter: blur(8px);
    inset: -3px;
    animation: none;
    background: linear-gradient(135deg,
            var(--accent-purple),
            rgba(0, 245, 255, 0.85),
            var(--accent-purple));
}

.best-pages-grid .page-card.glinting:hover::before {
    /* Keep gold flash visible if glinting while hovered, but lean into hover palette */
    animation: none;
    opacity: 1;
    filter: blur(8px);
    inset: -3px;
    background: linear-gradient(135deg,
            var(--accent-purple),
            rgba(0, 245, 255, 0.9),
            var(--accent-purple));
}

.best-pages-grid .page-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: rgba(0, 245, 255, 0.45);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6), 0 0 22px rgba(0, 245, 255, 0.18);
}

@keyframes featured-gold-glint {
    0% {
        background-position: 0% 50%;
        opacity: 0.65;
        filter: blur(0px);
        box-shadow: 0 0 0 rgba(251, 191, 36, 0);
    }

    35% {
        background-position: 55% 50%;
        opacity: 1;
        filter: blur(2px);
        box-shadow: 0 0 18px rgba(251, 191, 36, 0.35);
    }

    70% {
        background-position: 100% 45%;
        opacity: 1;
        filter: blur(1px);
        box-shadow: 0 0 12px rgba(245, 158, 11, 0.28);
    }

    100% {
        background-position: 140% 50%;
        opacity: 0.55;
        filter: blur(0px);
        box-shadow: 0 0 0 rgba(251, 191, 36, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .best-pages-grid .page-card.glinting::before {
        animation: none;
        opacity: 0.9;
        background: linear-gradient(120deg, #b45309, #fbbf24, #fde68a, #f59e0b);
    }
}


/* Optional: Gradient text for headers if preferred
.section-title {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}
*/


/*
* === FINAL, WORKING MOBILE NAVIGATION SYSTEM ===
*/
@media (max-width: 768px) {

    /* --- Basic Mobile Layout Adjustments --- */
    body {
        padding: 0;
    }

    .app-container {
        padding: 0 1rem;
        margin-top: 1rem;
        gap: 1rem;
    }

    .top-section-grid {
        grid-template-columns: 1fr;
        /* Stack on mobile */
    }

    /* --- MOBILE PROFILE PICTURE REFINEMENTS --- */
    .profile-picture-wrapper {
        /* Set fixed mobile size - No shrink animation on mobile */
        width: 280px !important;
        height: 280px !important;
        transition: filter 1.2s ease-out, opacity 1.2s ease-out, -webkit-filter 1.2s ease-out !important;
    }

    .profile-picture {
        /* Ensure image fits the smaller mobile container */
        width: 100% !important;
        height: 100% !important;
    }

    /* ------------------------------------------ */

}

@media (max-width: 1100px), (hover: none) and (pointer: coarse) {
    .xw-main-nav-header {
        padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
        padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
    }

    .xw-main-nav-header .header-content {
        min-height: 3.1rem;
        justify-content: space-between;
    }

    .xw-main-nav-header .logo {
        position: relative;
        z-index: 10006;
    }

    .nav-header-actions {
        position: relative;
        z-index: 10006;
        margin-left: auto;
    }

    .nav-search-trigger {
        width: 48px;
        height: 48px;
        min-height: 48px;
        padding: 0;
        border-radius: 14px;
    }

    .nav-search-label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .nav-search-icon {
        width: 1.2rem;
        height: 1.2rem;
    }

    .nav-toggle {
        position: relative;
        z-index: 10006;
        display: inline-flex;
        flex: 0 0 48px;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        padding: 0;
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.055);
        color: var(--text-primary);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .nav-toggle-icon,
    .nav-toggle-icon span {
        display: block;
    }

    .nav-toggle-icon {
        position: relative;
        width: 22px;
        height: 16px;
    }

    .nav-toggle-icon span {
        position: absolute;
        left: 0;
        width: 22px;
        height: 2px;
        border-radius: 999px;
        background: currentColor;
        transform-origin: center;
        transition: top 180ms ease, transform 180ms ease, opacity 140ms ease;
    }

    .nav-toggle-icon span:nth-child(1) {
        top: 0;
    }

    .nav-toggle-icon span:nth-child(2) {
        top: 7px;
    }

    .nav-toggle-icon span:nth-child(3) {
        top: 14px;
    }

    .nav-is-open .nav-toggle-icon span:nth-child(1) {
        top: 7px;
        transform: rotate(45deg);
    }

    .nav-is-open .nav-toggle-icon span:nth-child(2) {
        opacity: 0;
        transform: scaleX(0.5);
    }

    .nav-is-open .nav-toggle-icon span:nth-child(3) {
        top: 7px;
        transform: rotate(-45deg);
    }

    .main-nav {
        position: fixed;
        top: var(--xw-site-nav-height);
        right: 0;
        bottom: 0;
        z-index: 10005;
        width: min(92vw, 36rem);
        min-width: min(100%, 20rem);
        padding: 0 max(1rem, env(safe-area-inset-right, 0px)) max(1.25rem, env(safe-area-inset-bottom, 0px)) 1rem;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        border-left: 1px solid rgba(255, 255, 255, 0.13);
        background: rgba(8, 8, 14, 0.985);
        -webkit-backdrop-filter: blur(22px) saturate(140%);
        backdrop-filter: blur(22px) saturate(140%);
        box-shadow: -24px 20px 70px rgba(0, 0, 0, 0.5);
        visibility: hidden;
        pointer-events: none;
        transform: translate3d(102%, 0, 0);
        transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), visibility 220ms;
        scrollbar-gutter: stable;
    }

    .nav-is-open .main-nav {
        visibility: visible;
        pointer-events: auto;
        transform: translate3d(0, 0, 0);
    }

    .nav-backdrop {
        position: fixed;
        inset: var(--xw-site-nav-height) 0 0;
        z-index: 10004;
        display: block;
        width: 100%;
        height: auto;
        padding: 0;
        border: 0;
        background: rgba(3, 3, 8, 0.68);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        -webkit-tap-highlight-color: transparent;
        transition: opacity 180ms ease, visibility 180ms;
    }

    .nav-is-open .nav-backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .xw-main-nav-header .logo {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
    }

    .xw-main-nav-header .logo span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .nav-header-actions {
        flex: 0 0 auto;
    }

    .xw-page-order-header {
        display: inline-flex;
        position: relative;
        flex: 0 0 auto;
    }

    .xw-page-order-header .xw-page-order-select {
        height: 48px;
        min-height: 48px;
        padding: 0 1.7rem 0 0.7rem;
        border-radius: 14px;
        font-size: 16px;
        line-height: 1.2;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .xw-page-order-panel {
        display: none;
    }

    .nav-panel-heading {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 0.65rem 1rem;
        position: sticky;
        top: 0;
        z-index: 5;
        margin: 0 -1rem 0.35rem;
        margin-right: calc(-1 * max(1rem, env(safe-area-inset-right, 0px)));
        padding: 0.9rem max(1rem, env(safe-area-inset-right, 0px)) 0.75rem 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        background: rgba(8, 8, 14, 0.98);
        color: var(--text-primary);
        font-size: 1.15rem;
        font-weight: 700;
    }

    .nav-panel-hint {
        color: var(--text-muted);
        font-size: 0.74rem;
        font-weight: 500;
    }

    .nav-links {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0.3rem;
    }

    .nav-top-level {
        width: 100%;
    }

    .nav-top-link,
    .nav-disclosure {
        justify-content: space-between;
        width: 100%;
        min-height: 48px;
        padding: 0.72rem 0.85rem;
        font-size: 0.98rem;
        text-align: left;
    }

    .nav-has-dropdown.is-open > .nav-disclosure {
        border-color: rgba(0, 245, 255, 0.22);
        border-radius: 13px 13px 8px 8px;
        background: rgba(0, 245, 255, 0.075);
    }

    .nav-dropdown {
        position: static;
        width: 100%;
        max-height: none;
        margin: 0.3rem 0 0.45rem;
        padding: 0.65rem;
        overflow: visible;
        border-color: rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.035);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        box-shadow: none;
        transform: none;
    }

    .nav-dropdown-header {
        position: static;
        top: auto;
        z-index: auto;
        align-items: center;
        margin: 0 0 0.45rem;
        padding: 0.1rem 0.15rem 0.55rem;
        background: transparent;
    }

    .nav-eyebrow {
        display: none;
    }

    .nav-dropdown-title {
        font-size: 0.86rem;
    }

    .nav-view-all {
        min-height: 40px;
        padding: 0.6rem;
    }

    .nav-submenu,
    .nav-dropdown-wide .nav-submenu {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
        gap: 0.2rem;
    }

    .nav-submenu a {
        min-height: 46px;
        padding: 0.7rem;
        font-size: 0.9rem;
    }

    .nav-item-icon {
        width: 1.25rem;
        height: 1.25rem;
    }

    .nav-view-toggle button {
        min-height: 44px;
        padding: 0.4rem 0.7rem;
        font-size: 0.85rem;
    }

    .nav-dropdown-tools .nav-view-toggle {
        display: none;
    }

    [data-site-header][data-nav-view="icons"] .nav-submenu,
    [data-site-header][data-nav-view="icons"] .nav-dropdown-wide .nav-submenu {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 8.75rem), 1fr));
        gap: 0.4rem;
    }

    [data-site-header][data-nav-view="icons"] .nav-submenu a {
        min-height: 0;
        padding: 1rem;
    }

    [data-site-header][data-nav-view="icons"] .nav-item-icon {
        width: 100%;
        height: 100%;
    }

    [data-site-header][data-nav-view="icons"] .nav-item-icon-emoji {
        font-size: 86cqi;
    }

    html.nav-open {
        overscroll-behavior: none;
    }

    body.nav-open {
        overflow: hidden;
        overscroll-behavior: none;
    }
}

@media (max-width: 540px) {
    .xw-page-order-header .xw-page-order-label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
}

@media (max-width: 360px) {
    .xw-main-nav-header .logo span {
        display: none;
    }
}

@media (max-width: 430px) {
    .xw-main-nav-header .logo span {
        max-width: 8.5rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .main-nav {
        width: 100%;
        border-left: 0;
    }

    .nav-panel-hint {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nav-toggle-icon span,
    .main-nav,
    .nav-backdrop,
    .nav-chevron {
        transition-duration: 0.01ms !important;
    }
}

/* --- Glow Buttons (Condensed Light) --- */
.glow-button {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-primary);
    text-decoration: none;
    background: rgba(10, 10, 15, 0.8);
    border: 1px solid transparent;
    border-radius: 50px;
    position: relative;
    z-index: 1;
    overflow: hidden;
    transition: color 0.3s ease, transform 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.glow-button::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50px;
    padding: 2px;
    /* Border thickness */
    background: var(--gradient-primary);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: -1;
}

.glow-button::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    opacity: 0;
    z-index: -2;
    transition: opacity 0.3s ease;
    filter: blur(15px);
}

.glow-button:hover {
    transform: translateY(-3px);
    color: #fff;
}

.glow-button:hover::after {
    opacity: 0.6;
    /* Spread glow on hover */
}

.about-glow-button {
    display: block;
    text-align: center;
    margin-top: 1.5rem;
}

/* --- Global Range Slider (Modern Antigravity) --- */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 24px;
    /* Thick track */
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.6);
    padding: 0 4px;
    /* Visual padding so thumb doesn't touch ends */
    margin: 10px 0;
}

input[type="range"]:focus {
    outline: none;
}

/* Webkit Track & Thumb */
input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 100%;
    cursor: pointer;
    background: transparent;
    border: none;
}

input[type="range"]::-webkit-slider-thumb {
    height: 14px;
    /* Thinner than track */
    width: 14px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 10px var(--accent-cyan);
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: 4px;
    /* Vertically center in 24px track (4px top + 14px thumb + 6px padding offset usually requires tweaking, 4px acts mostly okay) */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

input[type="range"]:hover::-webkit-slider-thumb,
input[type="range"]:focus::-webkit-slider-thumb {
    transform: scale(1.3);
    box-shadow: 0 0 15px var(--accent-purple), 0 0 25px var(--accent-cyan);
}

/* Firefox Track & Thumb */
input[type="range"]::-moz-range-track {
    width: 100%;
    height: 100%;
    cursor: pointer;
    background: transparent;
    border: none;
}

input[type="range"]::-moz-range-thumb {
    height: 14px;
    width: 14px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 10px var(--accent-cyan);
    cursor: pointer;
    border: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

input[type="range"]:hover::-moz-range-thumb,
input[type="range"]:focus::-moz-range-thumb {
    transform: scale(1.3);
    box-shadow: 0 0 15px var(--accent-purple), 0 0 25px var(--accent-cyan);
}

/* --- Recent pages editor --- */
.recent-editor {
    padding: 1.5rem;
}

.recent-editor:hover {
    transform: none;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    border-color: var(--glass-border);
}

.recent-editor-title {
    margin: 0 0 0.4rem;
    font-size: 1.35rem;
    color: var(--text-primary);
}

.recent-editor-copy,
.recent-editor-label {
    color: var(--text-secondary);
    margin: 0 0 0.85rem;
}

.recent-editor-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.recent-editor-search {
    width: 100%;
    box-sizing: border-box;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(8, 8, 14, 0.75);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.recent-editor-search::placeholder {
    color: var(--text-muted);
}

.recent-editor-search:focus {
    border-color: rgba(0, 245, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(0, 245, 255, 0.12);
}

.recent-editor-results,
.recent-editor-current {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-top: 0.85rem;
}

.recent-editor-results {
    max-height: 280px;
    overflow-y: auto;
    padding-right: 0.15rem;
}

.recent-editor-empty {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin: 0.25rem 0 0;
}

.recent-editor-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.85rem;
    align-items: center;
    padding: 0.7rem 0.85rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(10, 10, 15, 0.45);
}

.recent-editor-row img,
.recent-editor-row .recent-editor-emoji,
.recent-editor-row .recent-editor-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 8px;
}

.recent-editor-row .page-icon.recent-editor-icon {
    width: 40px;
    height: 40px;
    margin: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.recent-editor-emoji {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.recent-editor-row-copy {
    min-width: 0;
}

.recent-editor-row-copy strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.98rem;
    margin-bottom: 0.15rem;
}

.recent-editor-row-copy span {
    display: block;
    color: var(--text-muted);
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-editor-action {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(15, 15, 25, 0.7);
    color: var(--text-primary);
    border-radius: 999px;
    padding: 0.45rem 0.85rem;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.recent-editor-action:hover,
.recent-editor-action:focus-visible {
    border-color: rgba(0, 245, 255, 0.45);
    color: var(--accent-cyan);
    outline: none;
    transform: translateY(-1px);
}

.recent-editor-action.is-added {
    border-color: rgba(251, 191, 36, 0.35);
    color: #fbbf24;
}

.recent-editor-action.is-remove:hover,
.recent-editor-action.is-remove:focus-visible {
    border-color: rgba(248, 113, 113, 0.5);
    color: #f87171;
}

.recent-editor-divider {
    height: 1px;
    margin: 1.25rem 0 1rem;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
}

.recent-editor-subtitle {
    margin: 0;
    font-size: 1rem;
    color: var(--text-secondary);
}

.recent-editor-hint {
    margin: 0.35rem 0 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.recent-editor-row.is-sortable {
    grid-template-columns: auto auto 1fr auto;
    cursor: grab;
}

.recent-editor-row.is-dragging {
    opacity: 0.55;
    cursor: grabbing;
}

.recent-editor-row.is-drop-target {
    border-color: rgba(0, 245, 255, 0.45);
    box-shadow: 0 0 0 1px rgba(0, 245, 255, 0.2);
}

.recent-editor-drag {
    color: var(--text-muted);
    font-size: 0.95rem;
    letter-spacing: -0.12em;
    user-select: none;
    padding: 0 0.15rem;
}

.recent-editor-controls {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.recent-editor-action:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
}

.recent-editor-action.is-move {
    min-width: 2.2rem;
    padding-left: 0.55rem;
    padding-right: 0.55rem;
}

@media (max-width: 768px) {
    .recent-editor-row {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
    }

    .recent-editor-row.is-sortable {
        grid-template-columns: auto auto 1fr;
        grid-template-rows: auto auto;
    }

    .recent-editor-controls,
    .recent-editor-action {
        grid-column: 1 / -1;
        justify-self: stretch;
    }

    .recent-editor-controls {
        display: grid;
        grid-template-columns: 1fr 1fr auto;
    }

    .recent-editor-action {
        text-align: center;
    }
}

/* --- Hidden Pages Toggle --- */
.hidden-pages-toggle-container {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.toggle-button {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: var(--radius-xl);
}

.toggle-button:hover {
    background: var(--glass-bg);
    color: var(--text-primary);
    border-color: var(--accent-purple);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* --- Hidden Beta Section Styling --- */
.hidden-pages-container {
    padding: 2rem;
    background: rgba(5, 5, 10, 0.3);
    border-radius: var(--radius-xl);
    border: 1px dashed var(--glass-border);
    margin: 2rem 0;
}

.hidden-pages-container .section-title {
    margin-top: 0;
    border-left-color: var(--accent-orange);
    /* Orange accent for beta */
    color: var(--accent-orange);
}

.hidden-pages-container .page-card {
    background: rgba(40, 40, 45, 0.6);
    padding: 1.5rem;
    /* Slightly different dark background */
    border-color: rgba(245, 158, 11, 0.3);
    /* Subtle orange border */
}

.hidden-pages-container .page-card:hover {
    background: rgba(40, 40, 45, 0.8);
    border-color: var(--accent-orange);
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.15);
    /* Orange glow */
}

.hidden-pages-container .page-card h3 {
    color: var(--accent-orange) !important;
}

/* --- PREMIUM LOADING OVERLAY --- */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999999;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.6s;
}

#loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.premium-loader {
    overflow: visible;
    width: 100px;
    height: 125px;
}

.premium-loader g {
    animation: loader-slide var(--loader-duration) linear infinite;
}

.premium-loader g:nth-child(2) {
    animation-delay: calc(var(--loader-duration) / -4);
}

.premium-loader g:nth-child(2) path {
    animation-delay: calc(var(--loader-duration) / -4);
    stroke-dasharray: 0px calc(var(--loader-path-length) + 1px);
    stroke-dashoffset: 1px;
}

.premium-loader path {
    stroke: url(#loader-gradient);
    stroke-width: 20px;
    stroke-linecap: round;
    fill: none;
    stroke-dasharray: 0 var(--loader-path-length);
    stroke-dashoffset: 0;
    animation: loader-escalade var(--loader-duration) cubic-bezier(0.8, 0, 0.2, 1) infinite;
}

@keyframes loader-slide {
    0% {
        transform: translateY(50px);
    }

    100% {
        transform: translateY(-50px);
    }
}

@keyframes loader-escalade {
    0% {
        stroke-dasharray: var(--loader-path-length) var(--loader-path-length);
        stroke-dashoffset: calc(-1 * (var(--loader-path-length) - 1px));
    }

    50% {
        stroke-dasharray: var(--loader-path-length) var(--loader-path-length);
        stroke-dashoffset: 0;
    }

    100% {
        stroke-dasharray: 0 var(--loader-path-length);
        stroke-dashoffset: 0;
    }
}

/* Secondary login loader version */
.login-loader {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    opacity: 0.8;
}

.login-loader .premium-loader {
    width: 60px;
    height: 90px;
}

@media (prefers-reduced-motion: reduce) {
    #particle-canvas {
        display: none;
    }
}