.tp-chassis {
    width: 50%;
    min-width: 420px;
    max-width: 500px;
    position: absolute;
    aspect-ratio: var(--golden-aspect);
    left: 50%;
    bottom: 0;
    transform: translate(-50%, 40px);

    padding: 8px; /* border thickness */
    border-radius: 18px;
    background: linear-gradient(165deg, #dfe2e4 0%, #c9cdd0 50%, #e6e8ea 100%);
    box-shadow:
        -4.2px -5.6px 26px rgba(255, 255, 255, 0.25),
        4.9px 14px 31.2px rgba(10, 10, 12, 0.4),
        inset 0 1px 1px rgba(255, 255, 255, 0.4),
        inset 0 -1px 2px rgba(0, 0, 0, 0.3);
    transition:
        transform 200ms cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 200ms cubic-bezier(0.22, 1, 0.36, 1);
    cursor: pointer;
}
.tp-chassis:hover {
    box-shadow:
        -5.4px -7.2px 32px rgba(255, 255, 255, 0.25),
        6.3px 18px 38.4px rgba(10, 10, 12, 0.4),
        inset 0 1px 1px rgba(255, 255, 255, 0.4),
        inset 0 -1px 2px rgba(0, 0, 0, 0.3);
}
.tp-chassis:active {
    box-shadow:
        0 1.8px 8px rgba(15, 16, 18, 0.35),
        inset 0 1px 1px rgba(255, 255, 255, 0.35);
    transition:
        transform 70ms cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 70ms cubic-bezier(0.4, 0, 0.2, 1);
}

.tp-surface {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    overflow: hidden;
    user-select: none;
    background: linear-gradient(160deg, #f6f7f8 0%, #e2e4e6 14%, #c9cccf 48%, #dadcde 66%, #f2f3f4 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.85),
        inset 0 -1px 2px rgba(60, 64, 68, 0.35);
}
.tp-chassis:active .tp-surface {
    box-shadow:
        inset 0 5px 11px rgba(60, 64, 68, 0.35),
        inset 0 -2px 3px rgba(255, 255, 255, 0.85);
}

/* fine horizontal brushed grain */
.tp-brush {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: repeating-linear-gradient(
        0deg,
        rgba(255, 255, 255, 0.16) 0px,
        rgba(255, 255, 255, 0.03) 1px,
        rgba(0, 0, 0, 0.09) 2px,
        rgba(0, 0, 0, 0.02) 3px
    );
    background-size: 100% 3px;
    mix-blend-mode: overlay;
    opacity: 0.85;
}

/* the fingers the current gesture is playing with */
.tp-fingers {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* anisotropic sheen, shifts on hover */
.tp-sheen {
    position: absolute;
    inset: -20% -60%;
    pointer-events: none;
    background: linear-gradient(
        100deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.5) 42%,
        rgba(255, 255, 255, 0.65) 48%,
        rgba(255, 255, 255, 0.5) 54%,
        rgba(255, 255, 255, 0) 100%
    );
    mix-blend-mode: screen;
    opacity: 0.55;
    transform: translateX(-8%);
    transition:
        transform 450ms cubic-bezier(0.22, 1, 0.36, 1),
        opacity 200ms ease;
}
.tp-chassis:hover .tp-sheen {
    transform: translateX(6%);
    opacity: 0.9;
}
.tp-chassis:active .tp-sheen {
    opacity: 0.3;
}

/* lid-lip notch, clipped to the trackpad silhouette */
.tp-notch-clip {
    position: absolute;
    inset: 0;
    border-radius: 18px;
    overflow: hidden;
    pointer-events: none;
    z-index: 20;
}
.tp-notch {
    position: absolute;
    bottom: -13.5px;
    left: 50%;
    transform: translateX(-50%);
    width: 95px;
    height: 17px;
    border-radius: 7.14px;
    background: linear-gradient(180deg, #9ba0a5 0%, #c2c6c9 48%, #e4e6e8 100%);
    box-shadow:
        inset 0 4px 6px rgba(48, 52, 56, 0.55),
        inset 0 -2px 3px rgba(255, 255, 255, 0.55);
}
.tp-chassis:active .tp-notch {
    box-shadow:
        inset 0 5px 7px rgba(48, 52, 56, 0.65),
        inset 0 -2px 3px rgba(255, 255, 255, 0.6);
}
.tp-notch-hl {
    position: absolute;
    bottom: -13px;
    left: 50%;
    transform: translateX(-50%);
    width: 96px;
    height: 17px;
    border-radius: 7.65px;
    border-top: 1.2px solid rgba(255, 255, 255, 0.85);
    transition: border-color 200ms ease;
}
.tp-chassis:hover .tp-notch-hl {
    border-top-color: rgba(255, 255, 255, 0.95);
}

/* grounding shadow */
.tp-shadow {
    position: absolute;
    left: 50%;
    bottom: -52px;
    transform: translateX(-50%);
    width: 255px;
    height: 30px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0) 72%);
    filter: blur(2px);
    opacity: 0.65;
    pointer-events: none;
    z-index: -1;
    transition: opacity 220ms ease;
}
.tp-chassis:hover .tp-shadow {
    opacity: 0.8;
    filter: blur(3px);
}
.tp-chassis:active .tp-shadow {
    opacity: 0.55;
}

.tp-ripple {
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0);
    background: radial-gradient(circle, rgba(60, 64, 68, 0.35) 0%, rgba(0, 0, 0, 0) 70%);
    animation: tp-ripple 480ms cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

#click-hint {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -35px);
    text-wrap: nowrap;
    color: #ebebeb;
    pointer-events: none;
    user-select: none;
}

@keyframes tp-ripple {
    from {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0.8;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}
