/* =============================================================================================
   Shared site header: the bar of every page + the portal menu (site_header.php, site-header.js)

   Single source of the header breakpoints. Pages only know --site-header-h:
     full        > 87.5em (1400px)  desktop bar, unchanged look
     condensed   75em … 87.5em       desktop bar without social icons (they are in the footer)
     compact     <= 75em (1200px)    64px bar: logo, short CTA from 641px, menu button
   Classic max-width queries in em, in descending order: no gap at fractional zoom widths,
   and they scale with the visitor's font size. --sh-mode tells the script the stage.

   Rules of the house: what moves animates transform/opacity only. No @layer (the page CSS is
   unlayered and would win), an explicit transition on every link (the pages set
   `a { transition: all }`), no <label> (contact styles it globally), keyframes prefixed sh-.
   ============================================================================================= */

:root {
    --sh-mode: full;

    /* The bar itself, and everything the header occupies (+ the no-script link row). */
    --sh-bar-h: 109px;
    --site-header-h: var(--sh-bar-h);

    /* The part of the bar that covers the page right now: 0 while it is auto-hidden. */
    --sh-occlusion: var(--site-header-h);
    --sh-pad-x: 5%;

    scroll-padding-top: calc(var(--sh-occlusion) + 16px);
}

@media (max-width: 87.5em) {
    :root {
        --sh-mode: condensed;
    }
}

@media (max-width: 75em) {
    :root {
        --sh-mode: compact;
        --sh-bar-h: 64px;
        --sh-pad-x: clamp(12px, 4vw, 48px);
    }
}

/* Same-document scroll lock while the menu is open: no reflow, no iOS toolbar jump, nothing
   to restore. The gutter class is only set when the page had a classic scrollbar before. */
html.sh-locked {
    overflow: hidden;
    overscroll-behavior: none;
}

html.sh-locked.sh-gutter {
    scrollbar-gutter: stable;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* Cross-document view transitions: the header stays, the content fades over. */
@media (prefers-reduced-motion: no-preference) {
    @view-transition {
        navigation: auto;
    }
}

/* The header group stays put; the content fades over. */
::view-transition-group(site-header) {
    animation: none;
}

/* =============================================================================================
   Bar
   ============================================================================================= */

.site-header,
.site-menu {
    --sh-accent: var(--accent-color, #00e5ff);
    --sh-accent-alt: var(--accent-color-alt, #f0a);
    --sh-ink: var(--primary-color, #0c0f1d);
    --sh-text: var(--text-color, #fff);
    --sh-text-alt: var(--text-color-alt, #adb5bd);
    --sh-font: var(--font-primary, 'Raleway', sans-serif);
    --sh-mono: var(--font-mono, 'Space Mono', monospace);
    --sh-menu-bg: #0a0d1a;
    --sh-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

.site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    width: 100%;
    height: var(--sh-bar-h);
    padding: 0 var(--sh-pad-x);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(12, 15, 29, 0.8);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: var(--sh-text);
    font-family: var(--sh-font);
    line-height: 1.6;
    white-space: nowrap;
    transition: transform 0.32s var(--sh-ease);
    view-transition-name: site-header;
}

/* Denser glass and depth once the page moves under the bar (opacity only). */
.site-header::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgba(6, 8, 18, 0.6);
    box-shadow: 0 14px 34px -14px rgba(0, 0, 0, 0.75), 0 1px 0 rgba(0, 229, 255, 0.12);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.site-header.is-scrolled::before {
    opacity: 1;
}

.site-header[data-visibility="hidden"] {
    transform: translateY(-100%);
}

.site-header[data-visibility="hidden"]::before {
    opacity: 0;
}

/* Keyboard focus never sits in a hidden bar. */
.site-header:has(:focus-visible) {
    transform: none;
}

html.sh-menu-open .site-header {
    view-transition-name: none;
}

/* Reading progress: scroll-driven where supported, script-fed (--sh-progress) elsewhere.
   It sits under the bar's border, so when the bar slides away it stays docked at the top. */
.site-header-progress {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--sh-accent), var(--sh-accent-alt));
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.55);
    opacity: 0;
    transform: scaleX(var(--sh-progress, 0));
    transform-origin: 0 50%;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.site-header.is-scrolled .site-header-progress {
    opacity: 1;
}

@supports (animation-timeline: scroll()) {
    .site-header-progress {
        animation: sh-progress linear both;

        /* root, explicitly: body is a scroll container of its own (overflow-x: hidden). */
        animation-timeline: scroll(root block);
    }
}

@keyframes sh-progress {
    from {
        transform: scaleX(0);
    }

    to {
        transform: scaleX(1);
    }
}

.site-header :focus-visible,
.site-menu :focus-visible {
    outline: 2px solid var(--sh-accent);
    outline-offset: 4px;
}

/* Logo (bar) and brand (menu bar) — the menu bar copies the compact bar to the pixel. */
.site-header-logo,
.site-menu-brand {
    display: flex;
    align-items: center;
    color: var(--sh-text);
    font-family: var(--sh-mono);
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -1px;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.site-header-logo-img {
    width: 60px;
    height: 60px;
    margin-right: 10px;
}

.site-header-studio,
.site-menu-studio {
    color: var(--sh-accent);
}

/* Navigation */
.site-header-nav ul {
    display: flex;
    gap: 2rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-header-nav a {
    position: relative;
    padding: 0.5rem 0;
    color: inherit;
    font-weight: 400;
    letter-spacing: 1px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.site-header-nav a::after,
.site-lang-button::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--sh-accent);
    transform: scaleX(0);
    transform-origin: 0 50%;
    transition: transform 0.3s ease;
}

.site-header-nav a:hover::after,
.site-header-nav a[aria-current]:not([aria-current="false"])::after,
.site-lang-button[aria-expanded="true"]::after {
    transform: scaleX(1);
}

.site-header-nav-lang {
    display: none;
}

/* Social icons */
.site-header-social {
    display: flex;
    gap: 1.5rem;
}

.site-header-social-link {
    color: var(--sh-text);
    font-size: 1.2rem;
    text-decoration: none;
    transition: color 0.3s ease, transform 0.3s ease;
}

.site-header-social-link:hover {
    color: var(--sh-accent);
    transform: translateY(-3px);
}

/* Language switch: a real button (hover, click, Enter, Esc, outside click) */
.site-lang {
    position: relative;
    margin: 0 1.5rem;
}

.site-lang-button {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0.5rem 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    font-weight: 400;
    letter-spacing: 1px;
    cursor: pointer;
}

.site-lang-list {
    position: absolute;
    top: 100%;
    left: 50%;
    z-index: 1;
    min-width: 120px;
    margin: 0.5rem 0 0;
    padding: 0.5rem 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(26, 31, 53, 0.95);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) translateX(-50%) scale(0.95);
    transform-origin: top center;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

/* Hover bridge across the gap between button and list. */
.site-lang-list::before {
    content: '';
    position: absolute;
    right: 0;
    bottom: 100%;
    left: 0;
    height: calc(0.5rem + 2px);
}

/* Open: by the button, by a mouse hovering (script, .is-hover), and without script by
   keyboard focus or a hover-capable pointer. */
.site-lang-button[aria-expanded="true"] + .site-lang-list,
.site-lang.is-hover .site-lang-list,
html:not(.sh-ready) .site-lang:focus-within .site-lang-list {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) translateX(-50%) scale(1);
}

.site-lang.is-hover .site-lang-button::after {
    transform: scaleX(1);
}

@media (hover: hover) {
    html:not(.sh-ready) .site-lang:hover .site-lang-list {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) translateX(-50%) scale(1);
    }

    html:not(.sh-ready) .site-lang:hover .site-lang-button::after {
        transform: scaleX(1);
    }
}

.site-lang-list a {
    display: block;
    padding: 0.5rem 1.5rem;
    color: inherit;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.site-lang-list a:hover,
.site-lang-list a:focus-visible {
    background: rgba(0, 229, 255, 0.1);
    color: var(--sh-accent);
}

/* Call to action (the gradient pill of the site) */
.site-header-cta {
    position: relative;
    padding: 0.7rem 1.5rem;
    border-radius: 30px;
    background: linear-gradient(90deg, var(--sh-accent), var(--sh-accent-alt));
    color: var(--sh-ink);
    font-family: var(--sh-font);
    font-weight: 600;
    letter-spacing: 1px;
    text-decoration: none;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.site-header-cta::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 10px 20px rgba(0, 229, 255, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.site-header-cta:hover {
    transform: translateY(-3px) scale(1.05);
}

.site-header-cta:hover::after {
    opacity: 1;
}

.site-header-cta-short {
    display: none;
}

.site-header-cta-home,
.site-menu-cta-home {
    display: flex;
    align-items: center;
}

.site-header-cta-home i {
    margin-right: 8px;
}

/* Menu button + close button: the logo's three traces in a glass ring */
.site-header-toggle,
.site-menu-close {
    position: relative;
    display: none;
    flex: none;
    place-items: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.03) 64%);
    color: var(--sh-text);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.2s var(--sh-ease);
}

.site-menu-close {
    display: grid;
}

/* Slowly turning cyan-to-magenta rim (a masked ring; only rotates). */
.site-header-toggle::before,
.site-menu-close::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1.5px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--sh-accent), var(--sh-accent-alt) 35%, rgba(0, 229, 255, 0.12) 62%, var(--sh-accent));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    animation: sh-spin 7s linear infinite;
    pointer-events: none;
}

/* Once per session a soft ping says "this opens something". */
.site-header-toggle::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 1.5px solid var(--sh-accent);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
}

.site-header-toggle.sh-ping::after {
    animation: sh-ping 1.4s var(--sh-ease) 0.9s 2;
}

@media (hover: hover) {
    .site-header-toggle:hover,
    .site-menu-close:hover {
        transform: scale(1.06);
    }
}

.site-header-toggle:active,
.site-menu-close:active {
    transform: scale(0.92);
}

@keyframes sh-spin {
    to {
        transform: rotate(1turn);
    }
}

@keyframes sh-ping {
    from {
        opacity: 0.85;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(1.9);
    }
}

.sh-icon {
    display: block;
    width: 24px;
    height: 24px;
    overflow: visible;
}

.sh-line,
.sh-pad {
    fill: none;
    stroke-width: 1.8px;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}

.sh-line {
    stroke: currentcolor;
}

.sh-pad {
    stroke: var(--sh-accent);
}

/* In the menu the traces form the close cross: lines a and c cross in the centre, line b
   collapses, the solder pads die away. The choreography animates between both states. */
.site-menu .sh-line-a {
    transform: translate(12px, 12px) rotate(45deg) scaleX(1.4545);
}

/* Never scale to 0: with a non-scaling stroke the local stroke width would be 1.8 / 0. */
.site-menu .sh-line-b {
    opacity: 0;
    transform: translate(10.5px, 12px) scaleX(0.3);
}

.site-menu .sh-line-c {
    transform: translate(12px, 12px) rotate(-45deg) scaleX(2.2857);
}

.site-menu .sh-pad {
    opacity: 0;
}

.site-menu .sh-pad-a {
    transform: translate(16.5px, 7px) scale(1.8);
}

.site-menu .sh-pad-b {
    transform: translate(20.5px, 12px) scale(1.8);
}

.site-menu .sh-pad-c {
    transform: translate(12.5px, 17px) scale(1.8);
}

/* =============================================================================================
   Stages
   ============================================================================================= */

@media (max-width: 87.5em) {
    .site-header-social {
        display: none;
    }

    .site-header-nav ul {
        gap: 1.5rem;
    }

    .site-lang {
        margin: 0 0.75rem;
    }
}

@media (max-width: 75em) {
    .site-header {
        gap: 16px;
    }

    .site-lang {
        display: none;
    }

    /* Hidden in the compact bar; the <noscript> style turns it into a link row below it. */
    .site-header-nav {
        position: absolute;
        top: calc(100% + 1px);
        right: 0;
        left: 0;
        display: none;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        height: 41px; /* 40 + border: the bar (64) and the row end at 105 = --site-header-h */
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        background: rgba(12, 15, 29, 0.92);
        font-size: 0.9rem;
    }

    .site-header-nav ul {
        gap: 1.25rem;
    }

    .site-header-logo,
    .site-menu-brand {
        min-height: 44px;
        margin-right: auto;
        font-size: 1.3rem;
        letter-spacing: -0.5px;
    }

    .site-header-logo-img,
    .site-menu-brand-img {
        width: 40px;
        height: 40px;
        margin-right: 8px;
    }

    .site-header-cta {
        display: inline-flex;
        align-items: center;
        height: 40px;
        padding: 0 1.1rem;
        font-size: 0.78rem;
    }

    /* 48px hit area around the 40px pill. */
    .site-header-cta::before {
        content: '';
        position: absolute;
        inset: -4px -2px;
    }

    .site-header-cta-long {
        display: none;
    }

    .site-header-cta-short {
        display: inline;
    }

    /* On sub-pages the logo is the way home; the menu carries the full CTA. */
    .site-header-cta-home {
        display: none;
    }

    .site-header-toggle {
        display: grid;
    }
}

@media (max-width: 40em) {
    .site-header-cta {
        display: none;
    }
}

/* =============================================================================================
   Portal menu (native modal <dialog> in the top layer)
   ============================================================================================= */

.site-menu {
    position: fixed;
    inset: 0;

    /* Only matters where <dialog> has no top layer (the script then sets [open] itself). */
    z-index: 2001;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: hidden auto;
    overscroll-behavior: contain;
    border: 0;
    background: transparent;
    color: var(--sh-text);
    font-family: var(--sh-font);
    line-height: 1.5;
    scrollbar-width: none;
    -webkit-tap-highlight-color: transparent;
}

.site-menu::backdrop {
    background: transparent;
}

/* Solid unless the script animates the portal (also when the menu opened without script);
   with reduced motion the whole dialog fades instead. */
.site-menu[open]:not([data-state="opening"], [data-state="closing"]),
.site-menu.sh-fade[open] {
    background: var(--sh-menu-bg);
}

/* Sections the menu jumps to receive focus for screen readers, without a ring around them. */
.sh-focus-target:focus {
    outline: none;
}

/* Always a little taller than the dialog: it stays a scroll container, so
   overscroll-behavior: contain keeps every touch gesture inside the menu. */
.site-menu-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    min-height: calc(100% + 1px);
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

.site-menu-bar {
    display: flex;
    flex: none;
    align-items: center;
    box-sizing: border-box;
    height: 64px;
    padding: 0 var(--sh-pad-x);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* While the menu is open its bar carries the header's view-transition name: the next page's
   header grows out of it instead of the old header flashing over the menu. */
html.sh-menu-open .site-menu-bar {
    view-transition-name: site-header;
}

.site-menu-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: space-between;
    gap: 28px;
    box-sizing: border-box;
    width: min(100% - 2 * var(--sh-pad-x), 36rem);
    margin: 0 auto;
    padding-top: clamp(12px, 4vh, 48px);
}

.site-menu-nav ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-menu-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 72px;
    padding: 6px 4px;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--sh-text);
    font-size: clamp(1.75rem, 8.6vw, 3.1rem);
    font-weight: 800;
    letter-spacing: 0.5px;
    line-height: 1.1;
    text-decoration: none;
    text-transform: uppercase;
    transition: color 0.25s ease, transform 0.2s var(--sh-ease);
}

.site-menu-link:active {
    transform: scale(0.985);
}

.site-menu-link[aria-current]:not([aria-current="false"]) {
    color: var(--sh-accent);
}

/* Light sweep on tap (started by the script, transform only). */
.site-menu-link::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 20%, rgba(0, 229, 255, 0.22) 50%, transparent 80%);
    opacity: 0;
    transform: translateX(-100%);
    pointer-events: none;
}

.site-menu-index {
    align-self: flex-start;
    min-width: 2.4em;
    padding-top: 0.75em;
    color: var(--sh-accent);
    font-family: var(--sh-mono);
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 1px;
}

.site-menu-label {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
}

.site-menu-arrow {
    flex: none;
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentcolor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    opacity: 0.35;
    transform: translateX(-8px);
    transition: opacity 0.3s ease, transform 0.3s var(--sh-ease);
}

.site-menu-link:hover .site-menu-arrow,
.site-menu-link:focus-visible .site-menu-arrow,
.site-menu-link[aria-current]:not([aria-current="false"]) .site-menu-arrow {
    opacity: 1;
    transform: none;
}

.site-menu-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px 12px;
}

.site-menu-cta {
    position: relative;
    display: flex;
    flex-basis: 100%;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-sizing: border-box;
    min-height: 52px;
    padding: 0 24px;
    border-radius: 30px;
    background: linear-gradient(90deg, var(--sh-accent), var(--sh-accent-alt));
    box-shadow: 0 12px 30px -10px rgba(0, 229, 255, 0.55);
    color: var(--sh-ink);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    white-space: normal;
    transition: transform 0.2s var(--sh-ease);
}

.site-menu-cta:active {
    transform: scale(0.97);
}

.site-menu-langs {
    display: flex;
    gap: 6px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.04);
}

.site-menu-lang {
    display: grid;
    place-items: center;
    box-sizing: border-box;
    min-width: 56px;
    height: 44px;
    padding: 0 16px;
    border-radius: 22px;
    color: var(--sh-text-alt);
    font-family: var(--sh-mono);
    font-weight: 700;
    letter-spacing: 1px;
    text-decoration: none;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.site-menu-lang[aria-current] {
    background: rgba(0, 229, 255, 0.14);
    box-shadow: inset 0 0 0 1px rgba(0, 229, 255, 0.35);
    color: var(--sh-accent);
}

.site-menu-lang:hover {
    color: var(--sh-text);
}

.site-menu-social {
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-menu-social-link {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--sh-text);
    font-size: 1.1rem;
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s var(--sh-ease);
}

.site-menu-social-link:hover {
    color: var(--sh-accent);
}

.site-menu-social-link:active {
    transform: scale(0.92);
}

.site-menu-more {
    flex-basis: 100%;
}

.site-menu-more ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0 22px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-menu-more-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--sh-text-alt);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-menu-more-link:hover {
    color: var(--sh-text);
}

.site-menu-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* --- Stage: portal, neon floor, horizon, orbs, scan line (all aria-hidden decoration) ------ */

.site-menu-stage {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

/* The reveal: a circle at the menu button, scaled up (transform only). Its diameter is
   chosen by the script so the layer stays below 2x the viewport; the rim glows. */
.site-menu-portal {
    position: absolute;
    top: var(--sh-oy, 32px);
    left: var(--sh-ox, 100%);
    width: var(--sh-d, 100vmin);
    height: var(--sh-d, 100vmin);
    border-radius: 50%;
    background: radial-gradient(circle closest-side, var(--sh-menu-bg) 0 90%, rgba(0, 229, 255, 0.5) 96.5%, rgba(255, 0, 170, 0.22) 98.5%, transparent 100%);
    transform: scale(0);
    translate: -50% -50%;
}

.site-menu-depth {
    position: absolute;
    inset: 0;
}

/* Perspective neon floor. The plane lies on the floor (rotated about its near edge) and is
   tall enough to run into the vanishing point on the horizon; its grid is one tile taller
   than the plane and drifts exactly one tile, so the loop is seamless. The mask fades it
   into the horizon. Layer budget: 1.3 x 1.16 viewports. */
.site-menu-floor {
    position: absolute;
    right: -15%;
    bottom: 0;
    left: -15%;
    height: 58%;
    perspective: 320px;
    perspective-origin: 50% 0;

    /* A pool of light: fades into the horizon and hides the plane's converging edges. */
    -webkit-mask-image: radial-gradient(ellipse 60% 100% at 50% 100%, #000 30%, rgba(0, 0, 0, 0.55) 62%, transparent 100%);
    mask-image: radial-gradient(ellipse 60% 100% at 50% 100%, #000 30%, rgba(0, 0, 0, 0.55) 62%, transparent 100%);
}

.site-menu-plane {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 200%;
    overflow: hidden;
    transform: rotateX(64deg);
    transform-origin: 50% 100%;
}

.site-menu-grid {
    position: absolute;
    inset: -56px 0 0;
    background-image:
        linear-gradient(rgba(0, 229, 255, 0.6) 2px, transparent 2px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.42) 2px, transparent 2px);
    background-position: 50% 0;
    background-size: 56px 56px;
    animation: sh-floor 2.4s linear infinite;
}

@keyframes sh-floor {
    to {
        transform: translateY(56px);
    }
}

.site-menu-horizon {
    position: absolute;
    top: 42%;
    right: 0;
    left: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 4%, rgba(0, 229, 255, 0.9) 34%, rgba(255, 0, 170, 0.85) 66%, transparent 96%);
    box-shadow: 0 0 22px 3px rgba(0, 229, 255, 0.3);
    opacity: 0.55;
}

.site-menu-orb {
    position: absolute;
    width: 80vmax;
    height: 80vmax;
    border-radius: 50%;
}

.site-menu-orb-a {
    top: -42vmax;
    left: -40vmax;
    background: radial-gradient(circle closest-side, rgba(0, 229, 255, 0.22), rgba(0, 229, 255, 0));
}

.site-menu-orb-b {
    right: -46vmax;
    bottom: -12vmax;
    background: radial-gradient(circle closest-side, rgba(255, 0, 170, 0.17), rgba(255, 0, 170, 0));
}

.site-menu-scan {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 140px;
    background: linear-gradient(to bottom, transparent, rgba(0, 229, 255, 0.08) 70%, rgba(0, 229, 255, 0.55) 98%, transparent);
    opacity: 0;
    transform: translateY(-140px);
}

/* Without pointer or tilt the near layer drifts on its own. */
.site-menu.sh-idle[data-state="open"] .site-menu-depth-near {
    animation: sh-drift 16s ease-in-out infinite alternate;
}

@keyframes sh-drift {
    from {
        transform: translate3d(-2%, -1.5%, 0);
    }

    to {
        transform: translate3d(2%, 1.5%, 0);
    }
}

/* Lite stage for weak devices: no drift, no orbs (the script never sets .sh-idle in lite). */
html.sh-lite .site-menu-grid {
    animation: none;
}

html.sh-lite .site-menu-orb {
    display: none;
}

/* Tablets: a centred column. Landscape phones: two columns, the dialog scrolls. */
@media (orientation: landscape) and (max-height: 34em) {
    .site-menu-content {
        flex-direction: row;
        align-items: center;
        gap: 32px;
        width: min(100% - 2 * var(--sh-pad-x), 60rem);
        padding-top: 8px;
    }

    .site-menu-nav {
        flex: 1.15;
    }

    .site-menu-footer {
        flex: 1;
    }

    .site-menu-link {
        min-height: 56px;
        font-size: clamp(1.35rem, 7vh, 2.1rem);
    }
}

/* =============================================================================================
   Preferences and fallbacks
   ============================================================================================= */

@media (prefers-reduced-motion: reduce) {
    .site-header {
        transition: opacity 0.2s ease, transform 0s;
    }

    .site-header[data-visibility="hidden"] {
        opacity: 0;
        transition: opacity 0.2s ease, transform 0s 0.2s;
    }

    .site-header-toggle::before,
    .site-menu-close::before,
    .site-header-toggle.sh-ping::after,
    .site-menu-grid,
    .site-menu.sh-idle[data-state="open"] .site-menu-depth-near {
        animation: none;
    }

    .site-header-cta:hover,
    .site-header-social-link:hover {
        transform: none;
    }
}

@media (prefers-reduced-transparency: reduce) {
    .site-header {
        background: #0c0f1d;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .site-lang-list {
        background: #1a1f35;
    }
}

@media (forced-colors: active) {
    .sh-line,
    .sh-pad {
        stroke: CanvasText;
    }

    .site-header-toggle,
    .site-menu-close {
        border: 1px solid CanvasText;
    }

    .site-header-toggle::before,
    .site-menu-close::before {
        display: none;
    }
}

@media print {
    .site-header {
        position: static;
        background: none;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .site-header-toggle,
    .site-header-progress,
    .site-menu {
        display: none;
    }
}
