.adh-opening:not([open]),
.adh-opening [hidden] {
    display: none;
}

.adh-opening[open] {
    display: grid;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 20px;
    border: 0;
    box-sizing: border-box;
    place-items: center;
    overflow: auto;
    color: #f5e2b2;
    background:
        radial-gradient(ellipse at 51% 52%, #123f2e 0%, #102e23 38%, transparent 72%),
        #0a1c15;
}

.adh-opening-language {
    width: min(100%, 680px);
}

.adh-opening-gate-logo {
    display: block;
    width: clamp(78px, 11vw, 115px);
    height: auto;
    margin: 0 auto 32px;
}

.adh-opening-language-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.adh-opening-language-list a {
    display: grid;
    min-height: 66px;
    place-items: center;
    padding: 10px 6px;
    border: 1px solid #e6bd6c66;
    border-radius: 12px;
    background: #102e23;
    color: inherit;
    font: 650 clamp(.9rem, 3.8vw, 1.15rem) system-ui, sans-serif;
    text-decoration: none;
}

.adh-opening-language-list a:hover,
.adh-opening-language-list a[aria-current] {
    background: #224937;
}

.adh-opening-language-list a:focus-visible {
    outline: 2px solid #f5d38b;
    outline-offset: 3px;
}

@media (prefers-reduced-motion: no-preference) {
    .adh-opening-language:not([hidden]) {
        animation: adh-opening-gate-in 300ms ease-out both;
    }

    @keyframes adh-opening-gate-in {
        from { opacity: 0; transform: translateY(7px); }
        to { opacity: 1; transform: none; }
    }

    .adh-opening-stage:not([hidden]) {
        position: relative;
        width: min(91vw, 960px, 148svh);
        aspect-ratio: 8 / 5;
        display: grid;
        place-items: center;
    }

    .adh-opening-web {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        overflow: visible;
    }

    .adh-opening-logo {
        position: relative;
        width: 17%;
        height: auto;
        filter: drop-shadow(0 5px 20px #081d14);
        animation: adh-opening-logo-in 580ms cubic-bezier(.18, .68, .28, 1) 1110ms both;
    }

    .adh-opening-sculpture {
        position: absolute;
        width: 30%;
        aspect-ratio: 325 / 318;
        perspective: 720px;
        filter: drop-shadow(24px 32px 25px #010a07a6);
        animation: adh-opening-sculpture 1450ms cubic-bezier(.22, .72, .22, 1) both;
    }

    .adh-opening-object {
        display: block;
        width: 100%;
        height: 100%;
        overflow: visible;
        animation: adh-opening-turn 1450ms cubic-bezier(.22, .72, .22, 1) both;
    }

    .adh-opening-depth {
        fill: #15372b;
        stroke: #5a713f;
        stroke-width: 1.4;
        stroke-linejoin: round;
    }

    .adh-opening-depth use:first-child {
        fill: #0b251d;
        stroke: #b88642;
    }

    .adh-opening-surface, .adh-opening-madagascar {
        fill: url(#adh-opening-face);
        stroke: url(#adh-opening-bevel);
        stroke-linejoin: round;
        stroke-width: 2;
    }

    .adh-opening-engraving {
        stroke: #caf7cc;
        stroke-opacity: .34;
        stroke-width: 1;
    }

    .adh-opening-shine {
        fill: #e9ffd8;
        opacity: .12;
        animation: adh-opening-glint 1s ease-out both;
    }

    .adh-opening-orbits {
        stroke: #addabd;
        stroke-dasharray: 1 7;
        stroke-linecap: round;
        animation: adh-opening-orbit-in 1200ms ease-out both;
    }

    .adh-opening-beacons circle {
        fill: #fff0bd;
        filter: drop-shadow(0 0 4px #ffce6d);
        transform-box: fill-box;
        transform-origin: center;
        animation: adh-opening-node 370ms ease-out var(--delay, 330ms) both;
    }

    .adh-opening-beacons circle:nth-child(2) { --delay: 450ms; }
    .adh-opening-beacons circle:nth-child(3) { --delay: 570ms; }

    .adh-opening-origins path {
        stroke: #e7b561;
        stroke-width: 1.5;
        stroke-linecap: round;
        stroke-dasharray: 9 100;
        vector-effect: non-scaling-stroke;
        animation: adh-opening-signal 510ms ease-out var(--delay, 350ms) both;
    }

    .adh-opening-origins path:nth-child(2) { --delay: 480ms; }
    .adh-opening-origins path:nth-child(3) { --delay: 610ms; }

    .adh-opening-trace {
        stroke: #71af90;
        stroke-width: 1.2;
        stroke-linecap: round;
        stroke-dasharray: 100;
        vector-effect: non-scaling-stroke;
        animation: adh-opening-connect 630ms cubic-bezier(.22, .65, .3, 1) var(--delay, 420ms) both;
    }

    .adh-opening-routes path:nth-child(n+4) {
        --delay: 540ms;
    }

    .adh-opening-bridges .adh-opening-trace {
        stroke: var(--gold, #d9a441);
        stroke-width: 1.55;
        --delay: 650ms;
    }

    .adh-opening-bridges .adh-opening-trace:nth-child(2) { --delay: 770ms; }
    .adh-opening-bridges .adh-opening-trace:nth-child(3) { --delay: 1010ms; }
    .adh-opening-bridges .adh-opening-trace:nth-child(4) { --delay: 1120ms; }

    .adh-opening-packet {
        stroke: #ffe2a2;
        stroke-width: 2.6;
        stroke-linecap: round;
        stroke-dasharray: 4 100;
        vector-effect: non-scaling-stroke;
        animation: adh-opening-signal 570ms ease-in-out var(--delay, 690ms) both;
    }

    .adh-opening-packet:nth-child(6) { --delay: 960ms; }
    .adh-opening-packet:nth-child(7) { --delay: 1200ms; }

    .adh-opening-nodes circle {
        fill: #b5e0c6;
        transform-box: fill-box;
        transform-origin: center;
        animation: adh-opening-node 400ms cubic-bezier(.2, .7, .2, 1) var(--delay, 80ms) both;
    }

    .adh-opening-nodes circle:nth-child(3),
    .adh-opening-nodes circle:nth-child(5) {
        fill: #ffe2a2;
        --delay: 450ms;
    }

    .adh-opening-nodes circle:nth-child(n+6) { --delay: 210ms; }

    .adh-opening-ripples circle {
        stroke: var(--gold, #d9a441);
        stroke-width: 1;
        vector-effect: non-scaling-stroke;
        transform-box: fill-box;
        transform-origin: center;
        animation: adh-opening-ripple 510ms ease-out var(--delay, 500ms) both;
    }

    .adh-opening-ripples circle:nth-child(2) { --delay: 1170ms; }
    .adh-opening-ripples circle:nth-child(3) { --delay: 1440ms; }
    .adh-opening-ripples circle:nth-child(4) { --delay: 1680ms; }

    @keyframes adh-opening-connect {
        from { stroke-dashoffset: 100; opacity: 0; }
        25% { opacity: .85; }
        to { stroke-dashoffset: 0; opacity: .62; }
    }

    @keyframes adh-opening-signal {
        from { stroke-dashoffset: 4; opacity: 0; }
        18%, 82% { opacity: 1; }
        to { stroke-dashoffset: -100; opacity: 0; }
    }

    @keyframes adh-opening-node {
        from { opacity: 0; transform: scale(.35); }
        to { opacity: 1; transform: scale(1); }
    }

    @keyframes adh-opening-ripple {
        from { opacity: .8; transform: scale(.35); }
        to { opacity: 0; transform: scale(1.5); }
    }

    @keyframes adh-opening-sculpture {
        0% { opacity: 0; transform: scale(.68); }
        24%, 62% { opacity: 1; transform: scale(1); }
        100% { opacity: 0; transform: scale(.59); }
    }

    @keyframes adh-opening-turn {
        0% { transform: rotateX(36deg) rotateY(-51deg) rotateZ(-17deg); }
        58% { transform: rotateX(7deg) rotateY(15deg) rotateZ(4deg); }
        100% { transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
    }

    @keyframes adh-opening-glint {
        0% { opacity: 0; transform: translateX(-145px); }
        34% { opacity: .23; }
        100% { opacity: 0; transform: translateX(160px); }
    }

    @keyframes adh-opening-orbit-in {
        from { opacity: 0; }
        to { opacity: .28; }
    }

    @keyframes adh-opening-logo-in {
        from { opacity: 0; transform: translateY(6px) scale(.94); }
        to { opacity: 1; transform: translateY(0) scale(1); }
    }

    @media (max-width: 600px) {
        .adh-opening-stage { width: 98vw; }
        .adh-opening-logo { width: 22%; }
        .adh-opening-sculpture { width: 40%; }
    }
}

.adh-opening[open] { isolation: isolate; }
.adh-opening-language { z-index:1; position:relative; }
.adh-opening-network-art { position:absolute; z-index:-1; width:100%; height:100%; inset:0; pointer-events:none; }
.adh-opening-network-art .route { fill:none; stroke:#69a688; stroke-width:1.2; opacity:.35; }
.adh-opening-network-art .gold { stroke:#ce9e51; opacity:.39; }
.adh-opening-network-art .node { fill:#d9ab61; opacity:.59; }
.adh-opening-network-art .signal { fill:none; stroke:#f1cb80; stroke-width:2; stroke-linecap:round; stroke-dasharray:3 100; opacity:0; }
.adh-opening-network-art .halo { fill:none; stroke:#d9ab61; opacity:.28; }
.adh-opening-network-art .terrain { opacity:.63; }
@media (prefers-reduced-motion:no-preference) {
    .adh-opening-network-art .signal { animation:adh-language-signal 9s linear infinite; }
    .adh-opening-network-art .signal:nth-of-type(2) { animation-delay:-4.8s; }
    .adh-opening-network-art .signal:nth-of-type(3) { animation-delay:-2.7s; }
    .adh-opening-network-art .halo { animation:adh-language-halo 5s ease-in-out infinite alternate; }
    .adh-opening-network-art .terrain { animation:adh-language-terrain 13s ease-in-out infinite alternate; }
}
@keyframes adh-language-signal {
    0%, 70%, 100% { opacity:0; }
    6%, 59% { opacity:.88; }
    0% { stroke-dashoffset:3; }
    67%, 100% { stroke-dashoffset:-100; }
}
@keyframes adh-language-halo { to { opacity:.48; } }
@keyframes adh-language-terrain { to { opacity:.82; } }
@media (max-width:600px) {
    .adh-opening-network-art { opacity:.75; }
    .adh-opening-language-list { gap:8px; }
}
