* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    background: #e8dfcf;

    font-family:
        Georgia,
        "Times New Roman",
        serif;
}

.back-link {
    position: fixed;
    top: 22px;
    left: 22px;
    z-index: 30;

    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 10px 16px;

    border: 1px solid rgba(50, 40, 30, 0.28);
    border-radius: 999px;

    background: rgba(245, 238, 224, 0.8);
    box-shadow: 0 10px 25px rgba(44, 34, 25, 0.08);

    color: #302a24;
    text-decoration: none;
    font-family: Georgia, serif;
    font-size: 20px;
    line-height: 1;

    backdrop-filter: blur(4px);
    transition: transform 0.25s ease, background 0.25s ease;
}

.back-link:hover {
    transform: translateY(-1px);
    background: rgba(255, 250, 240, 0.92);
}

.back-link .back-text {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}


/* =========================================
   CANVAS
========================================= */

#paintCanvas {
    position: fixed;

    left: 0;
    top: 0;

    width: 100%;
    height: 100%;

    display: block;

    background: #e7dece;
}


/* =========================================
   PAPER TEXTURE
========================================= */

body::after {
    content: "";

    position: fixed;

    inset: 0;

    pointer-events: none;

    z-index: 5;

    opacity: 0.18;

    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.28'/%3E%3C/svg%3E");

    mix-blend-mode: multiply;
}


/* =========================================
   INTERFACE
========================================= */

.ui {

    position: fixed;

    z-index: 10;

    inset: 0;

    display: flex;

    flex-direction: column;

    justify-content: center;

    align-items: center;

    text-align: center;

    color: #302a24;

    background:
        radial-gradient(
            circle,
            rgba(250,245,235,0.35),
            rgba(190,175,150,0.12)
        );

    transition:
        opacity 1.2s ease,
        visibility 1.2s ease;
}


.ui.hidden {

    opacity: 0;

    visibility: hidden;

    pointer-events: none;
}


/* =========================================
   TEXT
========================================= */

.small-title {

    margin-bottom: 18px;

    font-family: Arial, sans-serif;

    font-size: 10px;

    letter-spacing: 5px;

    opacity: 0.45;
}


h1 {

    font-size:
        clamp(52px, 9vw, 100px);

    font-weight: normal;

    letter-spacing: -4px;
}


.ui p {

    margin-top: 22px;

    margin-bottom: 35px;

    font-size: 18px;

    line-height: 1.5;

    opacity: 0.58;
}


/* =========================================
   BUTTON
========================================= */

#micButton {

    height: 60px;

    min-width: 260px;

    padding: 0 28px;

    border:
        1px solid
        rgba(50,40,30,0.3);

    border-radius: 5px;

    background:
        rgba(245,238,224,0.75);

    color: #302a24;

    font-family:
        Georgia,
        serif;

    font-size: 15px;

    cursor: pointer;

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 12px;

    transition:
        transform .25s ease,
        background .25s ease,
        opacity .4s ease;
}


#micButton:hover {

    transform: translateY(-2px);

    background:
        rgba(255,250,240,0.9);
}


#micButton.active {

    opacity: .25;
}


.side-toggle {

    position: fixed;

    right: 24px;
    top: 50%;

    transform: translateY(-50%);

    width: 58px;
    height: 58px;

    border:
        1px solid
        rgba(50,40,30,0.3);

    border-radius: 50%;

    background:
        rgba(245,238,224,0.8);

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

    cursor: pointer;

    z-index: 11;

    box-shadow:
        0 10px 25px
        rgba(44,34,25,0.08);

    transition:
        transform .25s ease,
        background .25s ease,
        opacity .4s ease;
}


.side-toggle:hover {

    transform:
        translateY(-50%)
        scale(1.04);
}


.side-toggle.active {

    opacity: .3;
}


/* =========================================
   VISUALIZATION SWITCHER
========================================= */

.viz-switcher {

    position: fixed;

    z-index: 12;

    left: 50%;
    bottom: 26px;

    transform: translateX(-50%);

    display: flex;

    gap: 4px;

    padding: 5px;

    border: 1px solid rgba(50, 40, 30, 0.28);

    border-radius: 999px;

    background: rgba(245, 238, 224, 0.82);

    box-shadow: 0 10px 25px rgba(44, 34, 25, 0.08);

    backdrop-filter: blur(4px);
}


.viz-btn {

    padding: 8px 16px;

    border: none;

    border-radius: 999px;

    background: transparent;

    color: #302a24;

    font-family: Georgia, serif;

    font-size: 13px;

    cursor: pointer;

    opacity: 0.55;

    transition:
        background .2s ease,
        opacity .2s ease;
}


.viz-btn:hover {

    opacity: 0.85;

    background: rgba(255, 250, 240, 0.7);
}


.viz-btn.active {

    opacity: 1;

    background: rgba(101, 87, 72, 0.16);
}


.side-toggle .dot {

    width: 11px;
    height: 11px;
}


/* =========================================
   DOT
========================================= */

.dot {

    width: 9px;

    height: 9px;

    border-radius: 50%;

    background: #655748;
}


/* =========================================
   STATUS
========================================= */

.status {

    margin-top: 18px;

    font-family: Arial, sans-serif;

    font-size: 11px;

    opacity: 0;

    transition: opacity .4s ease;
}


.status.visible {

    opacity: .45;
}


/* =========================================
   ERROR
========================================= */

.error {

    position: fixed;

    z-index: 20;

    left: 50%;

    bottom: 30px;

    transform:
        translateX(-50%);

    width: min(90%, 500px);

    padding: 14px 18px;

    border:
        1px solid
        rgba(100,50,30,.2);

    background:
        rgba(240,226,204,.95);

    color: #684b3d;

    font-family: Arial, sans-serif;

    font-size: 12px;

    text-align: center;

    opacity: 0;

    visibility: hidden;

    transition:
        opacity .3s ease;
}


.error.visible {

    opacity: 1;

    visibility: visible;
}


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

@media(max-width:600px) {

    h1 {
        letter-spacing: -2px;
    }

    .ui p {
        font-size: 16px;
    }

    .viz-switcher {
        gap: 2px;
        padding: 4px;
    }

    .viz-btn {
        padding: 7px 10px;
        font-size: 11px;
    }

}