:root {
    --bg: #101113;
    --metal-1: #3a3d42;
    --metal-2: #25272b;
    --panel: #1b1c1f;
    --ink: #e7e6e2;
    --ink-dim: #8a8c91;
    --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
    --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    overflow-x: hidden
}

@media (prefers-reduced-motion:reduce) {
    * {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important
    }
}

.grain {
    position: fixed;
    inset: 0;
    z-index: 60;
    pointer-events: none;
    opacity: .045;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    animation: grain-shift 1.1s steps(4) infinite;
}

@keyframes grain-shift {
    0% {
        transform: translate(0, 0)
    }

    25% {
        transform: translate(-2%, 1%)
    }

    50% {
        transform: translate(1%, -2%)
    }

    75% {
        transform: translate(-1%, -1%)
    }

    100% {
        transform: translate(0, 0)
    }
}

.boot {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .5s ease, visibility .5s ease;
}

.boot.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none
}

.boot-box {
    font-family: var(--mono);
    font-size: .85rem;
    color: #9fe6cf;
    width: min(88vw, 460px);
    line-height: 1.9
}

.boot-line {
    opacity: 0;
    white-space: pre
}

.boot-line.show {
    opacity: 1
}

.boot-line .dim {
    color: var(--ink-dim)
}

.boot-cursor {
    display: inline-block;
    width: 7px;
    height: 14px;
    background: #9fe6cf;
    margin-left: 2px;
    animation: blink 900ms steps(1) infinite;
    vertical-align: middle
}

@keyframes blink {
    50% {
        opacity: 0
    }
}

.exit {
    position: fixed;
    inset: 0;
    z-index: 110;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .35s ease, visibility .35s ease;
}

.exit.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto
}

.exit-box {
    font-family: var(--mono);
    font-size: .85rem;
    width: min(88vw, 460px);
    line-height: 1.9
}

.exit-box {
    color: var(--unit-path, var(--ink))
}

.exit .boot-line {
    white-space: pre
}

.exit .bar {
    margin-top: 14px;
    height: 3px;
    width: 100%;
    background: rgba(255, 255, 255, .08);
    border-radius: 2px;
    overflow: hidden;
}

.exit .bar span {
    display: block;
    height: 100%;
    width: 0%;
    background: currentColor;
    border-radius: 2px;
    transition: width 1.1s cubic-bezier(.4, 0, .2, 1);
}

.exit .bar span.fill {
    width: 100%
}

.stage {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding: 6vh 4vw;
    opacity: 0;
    transition: opacity .7s ease;
}

.stage.ready {
    opacity: 1
}

.rack {
    width: min(920px, 100%);
    background: linear-gradient(180deg, var(--metal-1), var(--metal-2) 6%, var(--metal-2) 94%, var(--metal-1));
    border-radius: 10px;
    padding: 26px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .06);
    position: relative;
}

.rack::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 10px;
    pointer-events: none;
}

.rack-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 8px 20px;
    position: relative
}

.rack-head .plate {
    font-family: var(--mono);
    font-size: .68rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--ink-dim)
}

.rack-head .status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--mono);
    font-size: .65rem;
    color: #7be08a;
    letter-spacing: .1em
}

.rack-head .status .led {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #7be08a;
    box-shadow: 0 0 6px #7be08a;
    animation: pulse 2s ease-in-out infinite
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: .4
    }
}

.screw {
    position: absolute;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #6a6d73, #1c1d20 70%);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .4)
}

.screw::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 1px;
    background: #111;
    transform: translate(-50%, -50%) rotate(35deg)
}

.rack .screw.tl {
    top: 10px;
    left: 10px;
    rotate: 79deg
}

.rack .screw.tr {
    top: 10px;
    right: 10px;
    rotate: 334deg
}

.rack .screw.bl {
    bottom: 10px;
    left: 10px;
    rotate: 47deg
}

.rack .screw.br {
    bottom: 10px;
    right: 10px;
    rotate: 27deg
}

.units {
    display: flex;
    flex-direction: column;
    gap: 14px
}

.unit {
    display: flex;
    align-items: center;
    gap: 22px;
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 6px;
    padding: 20px 24px;
    text-decoration: none;
    color: var(--ink);
    position: relative;
    opacity: 0;
    transform: translateY(10px);
    animation: rise .6s cubic-bezier(.19, 1, .22, 1) forwards;
    transition: background .2s ease, transform .15s ease;
}

.stage.ready .unit--daniel {
    animation-delay: 120ms
}

.stage.ready .unit--olivier {
    animation-delay: 230ms
}

@keyframes rise {
    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.unit:hover,
.unit:focus-visible {
    background: #212226;
    outline: none
}

.unit:active {
    transform: scale(.995)
}

.led-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 34px;
    flex-shrink: 0
}

.led {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #555, #222 70%);
    box-shadow: inset 0 0 2px rgba(0, 0, 0, .7);
    transition: box-shadow .2s ease, background .2s ease;
}

.unit .led {
    background: radial-gradient(circle at 35% 30%, var(--unit-led-soft, #bbb), var(--unit-led, #666) 60%);
    box-shadow: 0 0 10px 2px var(--unit-glow, rgba(255, 255, 255, .35))
}

.led-col .led-label {
    font-family: var(--mono);
    font-size: .55rem;
    color: var(--ink-dim);
    letter-spacing: .08em
}

.info {
    flex: 1;
    min-width: 0
}

.info .tag {
    font-family: var(--mono);
    font-size: .62rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--ink-dim);
    margin-bottom: 4px
}

.info .name {
    font-weight: 800;
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    letter-spacing: -.01em
}

.info .path {
    font-family: var(--mono);
    font-size: .78rem;
    color: var(--unit-path, var(--ink-dim));
    margin-top: 2px
}

.led-matrix {
    display: grid;
    grid-template-columns: repeat(var(--led-cols, 3), 6px);
    grid-template-rows: repeat(var(--led-rows, 2), 6px);
    gap: 5px;
    flex-shrink: 0
}

.mled {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    box-shadow: inset 0 0 1px rgba(0, 0, 0, .6);
    transition: background .15s ease, box-shadow .15s ease
}

.unit .mled.lit {
    background: var(--unit-led, #999);
    box-shadow: 0 0 5px 1px var(--unit-glow-strong, rgba(255, 255, 255, .5))
}

.unit:focus-visible .mled {
    background: rgba(255, 255, 255, .18)
}

.switch {
    width: 52px;
    height: 26px;
    border-radius: 14px;
    flex-shrink: 0;
    background: #0f0f11;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, .6);
    position: relative;
    border: 1px solid rgba(255, 255, 255, .08);
}

.switch .knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(180deg, #c9cace, #8f9096);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .5);
    transition: transform .25s cubic-bezier(.34, 1.56, .64, 1);
}

.unit:hover .switch .knob,
.unit:focus-visible .switch .knob {
    transform: translateX(26px)
}

.unit:hover .switch,
.unit:focus-visible .switch {
    box-shadow: inset 0 0 8px var(--unit-glow-soft, rgba(255, 255, 255, .3))
}

.unit:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px
}

.unit.is-maintenance {
    cursor: not-allowed;
    pointer-events: none;
    overflow: hidden
}

.unit.is-maintenance .led {
    background: radial-gradient(circle at 35% 30%, #3a3b3e, #17181a 70%);
    box-shadow: inset 0 0 2px rgba(0, 0, 0, .8);
    animation: none
}

.unit.is-maintenance .mled,
.unit.is-maintenance .mled.lit {
    background: rgba(255, 255, 255, .04);
    box-shadow: none
}

.unit.is-maintenance .switch {
    opacity: .4
}

.unit.is-maintenance .info {
    opacity: .5
}

.ribbon {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 145%;
    transform: translate(-50%, -50%) rotate(-6deg);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 0;
    background: #f5c518;
    border-top: 5px solid;
    border-bottom: 5px solid;
    border-image: repeating-linear-gradient(45deg, #16171a 0 9px, #f5c518 9px 18px) 5;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .45);
    z-index: 5
}

.ribbon-icon {
    flex-shrink: 0
}

.ribbon-text {
    font-family: var(--sans);
    font-weight: 800;
    font-size: .72rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #16171a;
    white-space: nowrap
}

footer.foot {
    text-align: center;
    font-family: var(--mono);
    font-size: .65rem;
    color: var(--ink-dim);
    letter-spacing: .08em;
}

footer.foot kbd {
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 3px;
    padding: 1px 5px;
    margin: 0 2px
}

@media (max-width:600px) {
    .unit {
        gap: 14px;
        padding: 16px
    }

    .led-matrix {
        display: none
    }

    .led-col {
        width: 26px
    }

    .ribbon {
        width: 165%;
        padding: 5px 0
    }

    .ribbon-text {
        font-size: .62rem
    }
}