@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@100..900&display=swap');

:root {
    color-scheme: dark;
}

* {
    box-sizing: border-box;
    outline: none;
    list-style: none;
    padding: 0;
    margin: 0;
    font-family: 'Outfit';
}

body,
html {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1rem 1.5rem;
    user-select: none;
}

nav .title {
    font-size: 1.1rem;
}

nav .logo {
    width: 24px;
    aspect-ratio: 1 / 1;
    -webkit-user-drag: none;
}

nav .nav-links {
    margin-left: auto;
}

.nav-links a {
    text-decoration: none;
    color: inherit;
    font-size: 0.9rem;
    background: linear-gradient(to bottom right, #f95f5f, #ce0000);
    padding: 0.25rem 1rem;
    border-radius: 5px;
    outline: 2px solid transparent;
    transition: outline 0.2s ease;
}

.nav-links a:hover {
    outline-color: white;
}

.container {
    display: flex;
    align-items: start;
    max-width: 100vw;
    min-height: 100vh;
    padding: 1rem;
    gap: 1rem;
}

.container .editor {
    position: relative;
    display: block;
    flex: 1;
    height: 100%;
}

.editor #editor-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: none;
    border: none;
    resize: none;
    opacity: 0.2;
    z-index: 10;
    display: flex;
    padding: 1rem;
}

.editor #preview-code {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #080808;
    border: none;
    color: inherit;
    pointer-events: none;
    display: block;
    padding: 1rem;
}

#editor-input, #preview-code {
    font-family: monospace;
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: 0;
    tab-size: 4;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.container .preview {
    position: relative;
    height: 100%;
    aspect-ratio: 1 / 1;
    background: #222222;
}

.preview .svg,
.preview .grid {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.preview .svg {
    z-index: 200;
}

.preview #cursor-coords {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    color: white;
    font-family: monospace;
    font-size: 12px;
    pointer-events: none;
    user-select: none;
    z-index: 999;
    padding: 0.15rem 0.5rem;
    background: rgba(0, 0, 0, 0.3);
}

#autocomplete {
  position: absolute;
  background: #121212;
  color: #fff;
  border: 1px solid #333;
  border-radius: 4px;
  font-family: monospace;
  max-height: 150px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}
#autocomplete div {
  padding: 0.25rem 0.75rem;
  cursor: pointer;
  font-family: monospace;
}
#autocomplete div.selected {
  background: #da1a1a;
}

#caret-mirror {
  position: absolute;
  visibility: hidden;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: monospace;
  font-size: inherit;
  line-height: inherit;
}

.tag {
    color: #ff5370;
    font-family: monospace;
}
.attr {
    color: #82aaff;
    font-family: monospace;
}
.value {
    color: #c3e88d;
    font-family: monospace;
}

@media (max-width: 1200px) {
    body, html {
        display: block;
        max-width: 100vw;
        overflow-x: hidden;
    }
    .container {
        flex-direction: column;
        align-items: start;
        justify-content: center;
        gap: 1rem;
    }

    .container .editor {
        width: 100%;
        flex: 0;
        min-height: 500px;
    }

    .container .preview {
        flex: 0;
        width: 100%;
    }
}
