html.home,
html.home body {
    width: 100%;
    margin: 0;
    overflow-x: clip;
}

html.home body {
    min-height: 100dvh;
    overflow: clip;
}

@media (orientation: portrait) {
    html.home body {
        box-sizing: border-box;
        padding-bottom: 10dvh;
    }
}

html.js.home:not(.revealed) body {
    visibility: hidden;
}

/* Fade-out stuff */
body.page-transition > *:not(.frontpage-links) {
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.frontpage-links a:not(.selected-navigation-link) {
    transition: color 0.3s ease, opacity 0.3s ease;
}

body.page-transition .frontpage-links a:not(.selected-navigation-link) {
    opacity: 0;
    pointer-events: none;
}

.frontpage-links a.selected-navigation-link {
    opacity: 1;
    transition: opacity 0.5s ease 0.2s;
}

body.page-transition .frontpage-links a.selected-navigation-link {
    opacity: 0;
}

body.page-reset *,
body.page-reset *::before,
body.page-reset *::after {
    transition: none !important;
    animation: none !important;
}
/* End fade-out stuff */

.logo-container {
    --bird-name-right: 15%;
    position: relative;
    width: min(95vw, 800px);
}

.bird-names {
    position: absolute;
    bottom: calc(100% - 16px);
    left: 0;
    right: var(--bird-name-right);
}

.bird-name-text {
    min-height: 1.2em;
    text-align: right;
    font-style: italic;
    font-weight: 400;
    font-size: 14px;
    color: var(--lavender);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 2s;
}

.bird-names.instant .bird-name-text {
    transition: none;
}

.bird-name-text.visible {
    opacity: 1;
}

.logo-background {
    width: 100%;
}

.logo-full {
    position: absolute;
    width: 70%;
    left: 50%;
    top: 55%;
    transform: translate(-50%, -50%);
}

.frontpage-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.frontpage-links a {
    position: relative;
    isolation: isolate;
    text-decoration: none;
    font-size: 1.8rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.frontpage-links a::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: -200px -250px;
    border-radius: 50% / 45%;
    background:
        radial-gradient(
            ellipse,
            #4bf7e8 0%,
            var(--hover-colour) 5%,
            #c3d6bd 40%,
            transparent 100%
        );
    opacity: 0;
    filter: blur(10px);
    pointer-events: none;
    will-change: opacity;
}

.frontpage-links a.glow-enabled.glow-pulse::before {
    animation: glow-pulse 1.4s ease-out forwards;
}

@keyframes glow-pulse {
    0% {
        opacity: var(--glow-start-opacity, 0);
    }
    20% {
        opacity: 0.15;
    }
    100% {
        opacity: 0;
    }
}

@media (hover: hover) {
    .frontpage-links a:hover {
        color: var(--hover-colour);
        transition-duration: 0.4s;
    }
}

.node-row {
    display: flex;
    width: min(450px, 60vw);
    margin-inline: auto;
    margin-top: 20px;
    margin-bottom: 50px;
    justify-content: space-between;
    align-items: center;
    container-type: inline-size;
}

.node {
    width: min(140px, 40cqw);
    aspect-ratio: 7 / 5;
    --bar-height: 25px;
    border-radius: 16px;
    background: var(--darkgreen);
    position: relative;
}

.node::before {
    content: "";
    position: absolute;
    inset: 4px;
    top: var(--bar-height);
    background: var(--beige);
    border-radius: 0 0 12px 12px;
}

.node-label {
    position: absolute;
    top: calc(var(--bar-height) / 2);
    left: 14px;
    transform: translateY(-50%);
    color: var(--beige);
    font-size: 10px;
    letter-spacing: 0.05px;
    font-weight: 600;
}

.pin {
    position: absolute;
    width: 10px;
    height: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--beige);
    border: 3px solid var(--darkgreen);
    border-radius: 50%;
    touch-action: none;
}

#source-node-pin {
    cursor: grab;
}

body.cable-connected #source-node-pin {
    cursor: default;
}

body:not(.cable-connected):has(#source-node-pin:active),
body:not(.cable-connected):has(#source-node-pin:active) .pin {
    cursor: grabbing;
}

#output-node-pin-hit {
    position: absolute;
    left: 12px;
    top: 50%;
    width: 10px;
    height: 10px;
    transform: translateY(-50%);
    z-index: 3;
    pointer-events: none;
    touch-action: none;
}

#output-node-pin-hit::after {
    content: "";
    position: absolute;
    width: 30px;
    height: 30px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

body.cable-connected #output-node-pin-hit {
    pointer-events: auto;
    cursor: pointer;
}

.pin::after {
    content: "";
    position: absolute;
    width: 30px;
    height: 30px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

#source-node-pin {
    right: 12px;
}

#output-node-pin {
    left: 12px;
}

#output-volume-icon {
    position: absolute;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    pointer-events: none;
    visibility: hidden;
}

@media (pointer: coarse) {
    .node {
        touch-action: none;
    }
}

#cable-layer {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 2;
}

#cable {
    fill: none;
    stroke: var(--darkgreen);
    stroke-width: 5px;
    stroke-linecap: round;
}

#cable-hit-area {
    fill: none;
    stroke: transparent;
    stroke-width: 20px;
    pointer-events: stroke;
    touch-action: none;
}

#node-arrow {
    position: absolute;
    width: 40px;
    height: 40px;
    left: calc(100% + 15px);
    top: 10px;
}

.click-and-drag-text {
    position: absolute;
    left: calc(100% + 20px);
    top: -5px;
    font-style: italic;
    font-weight: 500;
    font-size: 12px;
    color: var(--lavender);
    white-space: nowrap;
}

@container (max-width: 400px) {
    #node-arrow {
        width: 30px;
        height: 30px;
        left: calc(100% + 5px);
        top: -6px;
    }

    .click-and-drag-text {
        left: calc(100% + 10px);
        top: -21px;
    }
}

@container (max-width: 350px) {
    .node {
        --bar-height: 23px;
    }

    .node-label {
        font-size: 9px;
    }
}

@container (max-width: 300px) {
    .node {
        --bar-height: 20px;
    }

    .node-label {
        left: 12px;
        font-size: 8px;
    }

    .pin {
        width: 8px;
        height: 8px;
    }

    #source-node-pin {
        right: 13px;
    }

    #output-node-pin {
        left: 13px;
    }
}

@media (max-width: 666px) {
    .node-row {
        margin-bottom: 35px;
    }

    .frontpage-links a {
        font-size: 1.6rem;
    }
}

@container (max-width: 220px) {
    .node {
        --bar-height: 16px;
    }

    .node-label {
        font-size: 6px;
    }

    #output-volume-icon {
        left: 32px;
    }
}
