:root {
    --page-padding: 60px;
    --left-panel-width: 875px;
    --column-gap: 40px;
}


/* =========================
   PAGE
   ========================= */

html,
body {
    margin: 0;
    width: 100%;
    min-height: 100%;
}

body {
    min-height: 100vh;
    position: relative;
    font-family: "IBM Plex Mono", monospace;
    overflow-x: hidden;
    /* Fallback behind pixel canvas */
    background:
        radial-gradient(
            circle at 20% 30%,
            rgba(46, 46, 46, 0.25),
            transparent 35%
        ),
        linear-gradient(
            90deg,
            #626666 0%,
            #353535 45%,
            #050505 100%
        );
}

body {
    font-family: "IBM Plex Mono", monospace;
    color: rgb(184, 213, 218);
}

button,
input,
textarea,
select {
    font-family: inherit;
}


/* Pixel background */
#pixelBackground {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 0;
    pointer-events: none;
}


/* Dark edge fade */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(
            circle at center,
            transparent 45%,
            rgba(0, 0, 0, 0.35) 100%
        );
    z-index: 0;
}


/* =========================
   GIANT BACKGROUND R56
   ========================= */

#backgroundR56 {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;

    font-family: "Chakra Petch", sans-serif;
    font-weight: 700;
    line-height: 0.8;
    letter-spacing: -0.08em;

    font-size: 125vh;

    color: rgba(70, 79, 81, 0.426);
}


/* =========================
   MAIN LAYOUT
   ========================= */

#pageLayout {
    position: relative;
    z-index: 10;
    min-height: 100vh;

    padding: 50px 40px 50px 40px;
    box-sizing: border-box;
}


#leftPanel {
    width: 48vw;

    min-height: calc(100vh - 100px);

    display: flex;

    align-items: center;
    justify-content: center;
}

#bottomControls {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
}


/* =========================
   MAIN LEFT PANEL
   ========================= */

.panel {
    width: 100%;
    max-width: 680px;

    min-height: 850px;

    padding: 68px 64px;

    box-sizing: border-box;

    background: rgba(13, 18, 18, 0.96);

    border: 1px solid rgba(120, 180, 185, 0.08);

    border-radius: 42px;

    box-shadow:
        0 30px 70px rgba(0, 0, 0, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.025);

    display: flex;
    flex-direction: column;

    gap: 30px;

    color: rgb(184, 213, 218);

    backdrop-filter: blur(8px);
}


/* Logo */

.r56doc-logo h1 {
    margin: 10px;
    margin-bottom: 30px;

    font-family: "Chakra Petch", sans-serif;
    font-size: 3rem;
    font-weight: 700;

    letter-spacing: 2px;

    color: rgb(104, 181, 194);
    padding-bottom: 10px;
    text-align: center;
}


/* Short product description */

#description {
    margin: 0;

    max-width: 420px;

    font-size: 1rem;
    line-height: 1.6;

    color: rgba(184, 213, 218, 0.75);
    text-align: center;
}


/* Getting started section */

#steps {
    display: flex;
    flex-direction: column;

    gap: 10px;

    margin-top: 8px;
    margin-bottom: 50px;
}


#steps p {
    margin: 0;

    font-size: 1rem;
    line-height: 1.55;
}


#steps p:first-child {
    margin-bottom: 8px;

    font-weight: 600;

    color: rgb(158, 205, 211);
}


/* Buttons */

#folderBox,
#connectButton {
    width: 100%;

    min-height: 58px;

    padding: 14px 22px;

    border-radius: 14px;

    font-family: "IBM Plex Mono", monospace;

    font-size: 1rem;
    font-weight: 700;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease;
}


/* Primary button */

#folderBox {
    border: 1px solid rgba(121, 181, 186, 0.18);

    background: rgb(37, 52, 52);

    color: rgb(235, 242, 243);
}


#folderBox:hover {
    background: rgb(45, 63, 63);

    transform: translateY(-2px);
}


/* Secondary button */

#connectButton {
    border: 1px solid rgba(255, 70, 70, 0.22);

    background: rgb(35, 47, 47);
    color: rgb(255, 74, 74);
}


#connectButton:hover {
    background: rgb(44, 56, 56);

    transform: translateY(-2px);
}


/* Connection status */

#status {
    margin: -10px 0 0;

    font-size: 0.82rem;

    color: rgba(184, 213, 218, 0.55);
}


/* Bottom feature words */

#keywords {
    margin-top: 30px;

    padding-top: 8px;

    font-size: 0.78rem;

    color: rgba(130, 190, 196, 0.55);

    word-spacing: 8px;
    text-align: center;
}


#status {
    margin-top: -12px;
    font-weight: 700;
    text-align: center;
}


/* =========================
   3D CAR
   ========================= */

#modelBackground {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 50%;
    right: 0;
    z-index: 2;
    overflow: hidden;
    pointer-events: none;
}

#miniCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}


/* =========================
   TABLET / MOBILE
   ========================= */

@media (max-width: 900px) {
    :root {
        --page-padding: 24px;
    }

    #pageLayout {
        padding:
            30px
            var(--page-padding);
    }

    #leftPanel {
        width: 48vw;
        min-height: calc(100vh - 100px);

        display: flex;
        align-items: center;
        justify-content: flex-start;
    }

    .r56-text {
        font-size: 120px;
    }

    .doc-text {
        font-size: 62px;
    }

    .r56doc-logo {
        padding-bottom: 32px;
    }

    #infoCard {
        width: min(360px, 100%);
    }

    #modelBackground {
        left: 0;
        right: 0;
        width: 100vw;
        height: 100vh;
    }

    #miniCanvas {
        opacity: 0.2;
    }

    #connectButton {
        min-width: 130px;

        padding: 0 18px;
    }
}


/* =========================
   SMALL PHONES
   ========================= */

@media (max-width: 450px) {
    #pageLayout {
        padding: 22px 16px;
    }

    #infoCard {
        width: min(320px, 100%);
        padding: 24px;
    }

    #actionRow {
        gap: 8px;
    }

    #folderBox {
        padding: 13px 14px;
    }

    #connectButton {
        min-width: 105px;
        padding: 0 12px;
        font-size: 0.9rem;
    }
}