:root {
    --spiral-stroke: rgb(100, 100, 100);
    --image-border: rgb(255, 255, 255);
    --image-height: 10%;
    --image-height-auto: 50%;
    --image-max-width: 10%;
    --image-max-width-auto: 80%;
    --offset: 4%;
    --hover-radius: 8%;
    --highlight: rgb(0, 0, 255);
    --button-color: rgb(140, 140, 140);
    --auto-mode-transition: 0.2s;
}

@font-face {
    font-family: 'Atlas Grotesk';
    src: url('typeface/AtlasGrotesk-Regular-Web.woff2') format('woff2'),
        url('typeface/AtlasGrotesk-Regular-Web.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-stretch: normal;
}

* {
    box-sizing: border-box;
}

textarea, select, input, button { outline: none; }

body {
    margin: 0;
    padding: 0 10px 0 10px;
    overflow: hidden;
    background: black;
    font-family: 'Atlas Grotesk', Helvetica, Arial, sans-serif;
    font-feature-settings: "liga", "kern";
    text-rendering: optimizelegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main {
    width: 100%;
    height: 100%;
    position: fixed;
    top: calc(var(--offset) * -1);
    left: 0;
}

.auto-button {
    position: fixed;
    bottom: 12px;
    left: 12px;
    width:5px;
    height:5px;
    background: white;
    display: none;
}

aside {
    position: fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background: black;
    z-index:100;
    opacity:0;
    pointer-events: none;
    transition: opacity var(--auto-mode-transition) ease-in;
}

aside.show {
    opacity: 1;
}

aside::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    width: 1px;
    height: 100%;
    background: white;
    transform: translateX(-50%);
    z-index: -1;
}

.aside-prompt {
    position: fixed;
    bottom: 0px;
    left: 0px;
    width:100%;
    text-align: center;
    padding-bottom: 20px;
    font-size: 30px;
    line-height: 30px;
    color: white;
}

.aside-gradient {
    position: fixed;
    bottom:0;
    left:50%;
    width:100%;
    transform: translate(-50%, 50%);
    height: 400px;
    background: radial-gradient(closest-side, rgba(0, 0, 255, 1) 0%, rgba(0, 0, 0, 0) 100%);
    z-index: -1;
    animation: gradient-float 5s ease-in-out infinite;
}

@keyframes gradient-float {
    0%, 100% { transform: translate(-50%, 50%) translateY(0); }
    50% { transform: translate(-50%, 50%) translateY(10%); }
}

.search-container {
    position: fixed;
    top: calc(50% - var(--offset));
    left: 50%;
    transform: translate(-50%, calc(-50% - var(--offset)));
    z-index: 1;
    border: 1px solid white;
    border-radius: 4px;
    background: black;
}

.search-input {
    padding: 14px 14px 15px 14px;
    font-size: 16px;
    line-height:16px;
    width: 200px;
    background: none;
    color: white;
    border: none;
    text-align: left;
    border-radius: 4px;
    font-family: 'Atlas Grotesk', Helvetica, Arial, sans-serif;
}

.search-button {
    position:relative;
    top:-2px;
    margin:0 8px 0 0;
    padding:11px;
    font-size: 10px;
    line-height: 10px;
    background: rgb(40, 40, 40);
    color: white;
    cursor: pointer;
    border:none;
    border-radius: 4px;
    font-family: 'Atlas Grotesk', Helvetica, Arial, sans-serif;
}

.search-button:hover {
    background: white;
    color: black;
}

.search-left {
    top: 20px;
    left: 20px;
    transform: translate(0, 0);
    border: 1px solid rgba(0, 0, 0, 0);
    background: rgb(30, 30, 30);
}

.search-left .search-input {
    padding:10px 10px 11px 10px;
}

.search-left .search-button {
    opacity: 0;
    margin:0 6px 0 0;
}

.search-left:hover {
    background: rgb(40, 40, 40);
}

.search-left:focus-within {
    background: rgb(40, 40, 40);
}

.search-left:focus-within .search-button {
    opacity: 1;
    background: black;
}

.search-left:focus-within .search-button:hover {
    opacity: 1;
    background:white;
}

/* SPIRAL */

.spiral {
    position:absolute;
    top:0;
    left:0;
    z-index:-1;
}

.spiral-base {
    stroke: url(#spiral-gradient);
    fill: none;
}

.spiral-highlight {
    stroke: var(--highlight);
    fill: none;
}

.mask-background {
    width: 100%;
    height: 100%;
    fill: black;
}

.hover-circle {
    fill: url(#circle-gradient);
    r: var(--hover-radius);
}

.spiral-image {
    position: absolute;
    height: 0;
    width: 0;
    display: block;
    transform-origin: center;
    background: white;
    border: 1px solid var(--image-border);
    cursor: pointer;
    opacity: 0;
}

.spiral-image.wide {
    max-width: var(--image-max-width);
}

.spiral-image.loaded {
    height: var(--image-height);
    width: auto;
}

.spiral-image.auto {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    transition: height 0.3s ease-out, width 0.3s ease-out, opacity 0.3s ease-out, top 0.5s ease-out;
}

.spiral-image.auto.loaded {
    height: var(--image-height-auto);
    width: auto;
}

.spiral-image.auto.wide {
    max-width: var(--image-max-width-auto);
}

.spiral-image.auto.visible {
    opacity: 1;
}

.spiral-image:hover {
    border: 1px solid var(--highlight);
}

.spiral-text {
    height: 0;
    width: 0;
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--highlight);
    color: white;
    text-align: center;
    cursor: pointer;
    opacity: 1;
    pointer-events: none;
    border: 1px solid var(--highlight);
    font-size: 14px;
    line-height: 18px;
    padding: 4px;
    -webkit-text-stroke: 2px var(--highlight);
    paint-order: stroke fill;
    transition: width 0.1s ease-out, height 0.1s ease-out, opacity 0.2s;
}

.spiral-text.auto {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
    line-height: 50px;
    transition: width 0.1s ease-out, height 0.1s ease-out, opacity 0.2s, top 0.5s ease-out;
}

.spiral-text.auto.hidden {
    opacity: 0;
}

.spiral-text.no-image {
    background:white;
    color:black;
    -webkit-text-stroke: 2px white;
    border: 1px solid white;
}

.spiral-image:hover + .spiral-text,
.spiral-text:hover {
    opacity: 1 !important;
    background: var(--highlight);
    border: 1px solid var(--highlight);
    color: white;
    -webkit-text-stroke: 2px var(--highlight);
}

.knotted-line {
    overflow: visible;
    cursor: pointer;
    z-index:10;
}

.knotted-line path {
    stroke: var(--spiral-stroke);
    stroke-width: 1;
    fill: none;
}

.knotted-line:hover path{
    stroke: var(--highlight);
}

@media only screen and (max-width: 800px) {
    :root {
        --image-height: 7%;
        --image-max-width: 7%;
    }

    .search-container {
        top: 12px;
        left: auto;
        right: 12px;
        width: calc(100% - 70px);
        transform: translate(0, 0);
        background: rgb(30, 30, 30);
        border:rgba(0, 0, 0, 0);
    }

    .search-input {
        padding:10px 10px 11px 10px;
    }

    .search-button {
        opacity: 0;
        margin:0 6px 0 0;
    }

    .search-container:hover {
        background: rgb(40, 40, 40);
    }
    
    .search-container:focus-within {
        background: rgb(40, 40, 40);
    }
    
    .search-container:focus-within .search-button {
        opacity: 1;
        background: black;
    }
    
    .search-container:focus-within .search-button:hover {
        opacity: 1;
        background:white;
    }

    .search-left {
        top: 12px;
        left: auto;
        right: 12px;
        width: calc(100% - 70px);
        transform: translate(0, 0);
    }

    .search-input {
        width:calc(100% - 68px);
    }
}