:root {
    --primary: #101010;
    /* --primary: #1B1B1B; */
    /* --button: #202530; */
    --secondary: #808893;
    --button: #191D26;
    --link: #69C9FF;
    --max-width: 146rem;
    --example-border-radius: 1.4rem;
    --color-selection-handle-size: 3.5rem;
    /* --outer-spacing: 1fr; */
}

/*
 * Legal Disclaimer for Web licence
 *
 * Licence to use self-hosted webfonts for displaying dynamic text on specified website domains. Our package includes WOFF and WOFF2 font formats.
 *
 * Should the license page views limit be exceeded the license holder will be required to contact Lineto.com for an upgrade.
 *
 * It is strictly prohibited to rename the font and to download or use these fonts in any other media.
 *
 * These Web fonts are licensed exclusively for the use on the following domain(s) and their subdomains:
 *
 * www.movingparts.io (monthly pageviews: <50K)
 *
 */

@font-face {
    font-family: "Unica77";
    font-weight: 400;
    src: url("/fonts/Unica77LLWeb-Regular.woff") format("woff");
}

@font-face {
    font-family: "Unica77";
    font-weight: 400;
    src: url("/fonts/Unica77LLWeb-Regular.woff2") format("woff2");
}

@font-face {
    font-family: "Unica77";
    font-weight: 500;
    src: url("/fonts/Unica77LLWeb-Regular.woff") format("woff");
}

@font-face {
    font-family: "Unica77";
    font-weight: 500;
    src: url("/fonts/Unica77LLWeb-Regular.woff2") format("woff2");
}

@font-face {
    font-family: "Unica77";
    font-weight: 600;
    src: url("/fonts/Unica77LLWeb-Medium.woff") format("woff");
}

@font-face {
    font-family: "Unica77";
    font-weight: 600;
    src: url("/fonts/Unica77LLWeb-Medium.woff2") format("woff2");
}

@font-face {
    font-family: "Unica77";
    font-weight: 700;
    src: url("/fonts/Unica77LLWeb-Bold.woff") format("woff");
}

@font-face {
    font-family: "Unica77";
    font-weight: 700;
    src: url("/fonts/Unica77LLWeb-Bold.woff2") format("woff2");
}

@font-face {
    font-family: "Whyte Semi-Mono";
    src: url("/fonts/MovingPartsMonoWhyteSemi-Mono-Regular.woff"), url("/fonts/MovingPartsMonoWhyteSemi-Mono-Regular.woff2");
}

body {
    margin: 0;
}

main {
    margin: 0 auto;
}

main,
article,
footer {
    overflow-x: hidden;
    display: grid;
    grid-template-columns: [full-start] 5% [main-start body-start] minmax(40%, 2fr) [body-end aside-start] minmax(375px, 1fr) [aside-end main-end] 5% [full-end];
    max-width: var(--max-width);
    column-gap: 0;
}

@media (max-width: 1199px) {
    main,
    article,
    footer {
        grid-template-columns: [full-start] 5vw [main-start body-start aside-start] 90vw [body-end aside-end main-end] 5vw [full-end];
    }
}

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

nav a {
    color: inherit;
    text-decoration: none;
}

article {
    grid-column: full;
}

a {
    color: var(--link);
    text-decoration: none;
}

html {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-size: 10px;
    background-color: var(--primary);

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

pre {
    margin: unset;
}

/* mobile */
article>* {
    grid-column: main;
}

article figure {
    background-color: #191D26;
}

article aside {
    /* justify-self: center; */
    max-width: 512px;
}

/* article aside.callout {
    max-width: unset;
} */

/* mobile */
@media (max-width: 1199px) {
    .line-number {
        display: none !important;
    }
}

/* not mobile */
@media (min-width: 1200px) {

    main,
    article,
    footer {
        column-gap: 4vw;
        --column-gap: 4vw;
    }

    /* sidebar with examples */
    article aside {
        grid-column: aside;
    }

    article>* {
        grid-column: body;
    }

    article section figure {
        margin-left: calc(var(--column-gap) * -1);
        border-radius: var(--example-border-radius);
    }
}

/* Margins */
article section {
    margin: unset;
}

article aside h3 {
    margin-top: 0;
}

article aside,
article figure,
article ol,
article p,
article section,
article ul {
    margin-top: unset;
    margin-bottom: 3rem;
}

article ul {
    padding-bottom: 2rem;
}

article ul li {
    margin-top: 1rem;
}

article :last-child {
    margin-bottom: unset;
}

/**/
article figure {
    overflow-x: auto;
    overflow-y: -moz-scrollbars-none;

    position: relative;
    border-radius: 1.2rem;
}

pre.language-swift {
    overflow-y: hidden !important;
}

article figure::-webkit-scrollbar {
    display: none;
}

/* body text */
article section,
footer {
    color: white;
    /* font-size: max(2.4rem, calc(2.4rem - 3vw)); */
    /* font-size: calc(2vw + 2vh + 1vmin); */
    font-size: min(2.4rem, 4.4vmin);
    line-height: 1.42;
    font-weight: 400;
    font-variation-settings: 'wght'430;
}

article section p,
article section ul,
article section ol,
footer p {
    max-width: 46ch;
}

article h2 {
    color: white;
    font-size: 4rem;
    /* margin-top: unset; */
}

header {
    margin-bottom: 2rem;
    margin-top: 4rem;
    margin-right: 3rem;
    grid-column: main;
}

header h1 {
    font-size: min(10rem, calc(3rem + 4vw));
    font-weight: 600;
    line-height: 1;
    letter-spacing: -1.3px;
    margin: 0;
    max-width: 13ch;
    color: white;
    /* font-variation-settings: 'wght' 400; */
}

article a.anchor {
    box-sizing: border-box;

    opacity: 0;

    font-weight: 500;

    float: left;
    width: 1.5ch;
    margin-left: -1.5ch;
    padding-right: 0.5ch;
    text-decoration: none;
}

article *:hover > a.anchor {
    opacity: 1;
}

header p {
    font-size: min(4.4rem, calc(2rem + 2vw));
    font-variation-settings: 'wght'360;
    font-weight: 400;
    line-height: 1.19;
    letter-spacing: -0.5px;
    margin-top: 3.8rem;
    color: var(--secondary);
    max-width: 32ch;
}

#gradient-meshes.header-image {
    height: 52vw;
    margin-top: -1rem;
    grid-column: full;
    background-image: url('/img/gradient-meshes-header.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 120vw auto;
}

#gradient-meshes.header-image img {
    display: none;
}

@media (min-width: 1200px) {
    #gradient-meshes.header-image {
        background-size: auto 90%;
        margin-top: unset;
        margin-bottom: unset;
        max-height: 58rem;
        overflow: visible;
    }
}

#markdown-teaser.header-image,
#styled-components-header.header-image,
#composable-styles-header.header-image {
    grid-column: main;
}

#markdown-teaser.header-image svg,
#styled-components-header.header-image svg,
#composable-styles-header.header-image svg {
    overflow: visible;
    max-width: 100%;
    height: auto;
}

@keyframes pulse-bg {
    0% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(0.98);
    }
}

@keyframes pulse-dot {
    0% {
        fill: #555;
    }

    100% {
        fill: #777;
    }
}

#markdown-teaser.header-image svg .bg {
    transform-box: fill-box;
    transform-origin: 50% 50%;
    animation: pulse-bg 3s ease-in-out 0s infinite alternate;
}

#markdown-teaser.header-image svg .bg:nth-child(3n+2) {
    animation: pulse-bg 4s ease-in-out 0.3s infinite alternate;
}

#markdown-teaser.header-image svg .bg:nth-child(3n+3) {
    animation: pulse-bg 5s ease-in-out 0.5s infinite alternate;
}

#markdown-teaser.header-image svg .dot {
    fill: #555;
    animation: pulse-dot 0.6s ease-in-out 0s infinite alternate;
    animation-delay: 0.0s;
}

#markdown-teaser.header-image svg .dot:nth-child(3n+2) {
    animation-delay: 0.2s;
}

#markdown-teaser.header-image svg .dot:nth-child(3n+3) {
    animation-delay: 0.4s;
}

@keyframes marching-ants {
    0% {
        stroke-dashoffset: 0;
    }

    100% {
        stroke-dashoffset: 10;
    }
}

#fonts-in-swiftui-header.header-image {
    grid-column: main;
}

#fonts-in-swiftui-header.header-image svg {
    overflow: visible;
    max-width: 100%;
    height: auto;
}

#fonts-in-swiftui-header.header-image svg .marching {
    animation: marching-ants 2s linear 0s infinite normal;
}

@media (max-width: 600px) {
    @keyframes marching-ants {
        0% {
            stroke-dashoffset: 0;
        }

        100% {
            stroke-dashoffset: 30;
        }
    }

    #fonts-in-swiftui-header.header-image svg {
        stroke-width: 8px;
    }

    #fonts-in-swiftui-header.header-image svg .marching {
        stroke-width: 8px;
    }

    #fonts-in-swiftui-header.header-image svg .marching {
        stroke-dasharray: 15;
    }
}

#variadic-views-header.header-image {
    grid-column: main;
}

#variadic-views-header.header-image svg {
    overflow: visible;
    max-width: 100%;
    height: auto;
}

aside,
aside label {
    color: var(--secondary);
    font-size: 1.7rem;
    font-weight: 500;
    font-variation-settings: 'wght'500;
    line-height: 1.4;
}

aside output {
    color: white;
    font-size: 4rem;
    display: block;
}

aside h3,
label {
    display: block;
    color: white;
    font-size: 100%;
    margin-bottom: 1rem;
}

aside input[type="range"] {
    width: 100%;
}

aside.callout {
    align-self: flex-start;
    border: 1px solid var(--secondary);
    padding: 5.5rem calc(3.2rem + 1vw);
    border-radius: var(--example-border-radius);
    font-size: 1.8rem;
    font-weight: 600;
    max-width: 512px;
    /* text-align: left; */
}

aside.table-of-contents p {
    margin-bottom: 0;
}

aside.table-of-contents ul {
    padding-inline-start: 0;
}

aside.table-of-contents li {
    list-style-type: none;
}

aside figure {
    padding: 5.5rem calc(3.2rem + 1vw);
}

aside blockquote {
    margin: unset;
    margin-bottom: 1rem;
}

aside blockquote p {
    display: inline;
}

aside blockquote::before {
    content: "“";
    margin-left: -1rem;
    position: relative;
    left: 0.1rem;
}

aside blockquote::after {
    content: "”";
    position: relative;
    left: -0.1rem;
}

figure {
    margin: unset;
}

input[type="color"] {
    -webkit-appearance: none;
    background-color: none;
    padding: 0;
    width: var(--color-selection-handle-size);
    height: var(--color-selection-handle-size);
}

input[type="color"],
input[type="color"]::-webkit-color-swatch-wrapper,
input[type="color"]::-webkit-color-swatch,
.canvas-holder handle {
    border-radius: var(--color-selection-handle-size);
    overflow: hidden;
    cursor: pointer;
}

input[type="color"],
.canvas-holder handle {
    border: 0.2rem solid white;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
}

pre {
    overflow-x: auto;
}

/* slider */
input[type='range'] {
    overflow: hidden;
    width: 100%;
    -webkit-appearance: none;
    border: 0.1rem solid #404040;
    background: var(--button);
    border-radius: 2rem;
    padding: 0.3rem;
    /* background-color: var(--secondary); */
}

input[type='range']::-webkit-slider-runnable-track {
    height: 2rem;
    -webkit-appearance: none;
    color: #13bba4;
}

input[type='range']::-webkit-slider-thumb {
    width: 2rem;
    height: 2rem;
    -webkit-appearance: none;
    cursor: ew-resize;
    background: white;
    border-radius: 1.4rem;
    /* box-shadow: -100% 0 0 1.4rem #43e5f7; */
}

.buttons-list {
    display: flex;
    margin: 2rem 0 2rem 0;
    align-items: flex-start;
    flex-wrap: wrap;
}

.buttons-list > * {
    margin-right: 2rem;
}

button {
    background-color: var(--button);
    padding: 1.5rem 2rem;
    border-radius: 1.2rem;
    color: white;
    font-size: 1.9rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    cursor: pointer;
    display: flex;
    align-content: center;
    margin-bottom: 2rem;
    /* outline: none; */
}

button.blue {
    --button: #6147EB;
}

button:before {
    margin-right: 1rem;
}

button.share {
    display: none;
}

.feature-native-share button.share {
    display: flex;
}

button .icon {
    margin-right: 1rem;
}

button.show-mesh svg {
    margin-top: 0.2rem;
}

.canvas-holder,
.image-holder,
.subheader-image-holder {
    /* display: inline-block; */
    position: relative;
    user-select: none;
    margin-bottom: 2rem;
}

.subheader-image-holder {
    margin-top: 8rem;
    margin-bottom: 0rem;
}

.canvas-holder canvas,
.image-holder img,
.subheader-image-holder img {
    max-width: 100%;
    width: 100%;
    border-radius: var(--example-border-radius);
}

@media (min-width: 1200px) {
    .subheader-image-holder img {
        max-width: 180%;
        width: 180%;
    }
}

.image-holder img.device {
    border-radius: unset;
}

body.wireframe-mode .canvas-holder canvas {
    border-radius: unset;
}

.canvas-holder-colors {
    display: flex;
    justify-content: space-between;
    /* align-items: center; */
}

.canvas-holder-colors>span label {
    display: flex;
    align-items: center;
    color: white;
    cursor: pointer;
}

.canvas-holder-colors .chevron {
    margin-left: .8rem;
    margin-top: .8rem;
}

.canvas-holder handle {
    box-sizing: border-box;

    position: absolute;
    width: var(--color-selection-handle-size);
    height: var(--color-selection-handle-size);
    display: block;
    margin-left: calc(var(--color-selection-handle-size) / -2);
    margin-top: calc(var(--color-selection-handle-size) / -2);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);

    user-select: none;
    cursor: grab;
}

body.dragging {
    cursor: grabbing !important;
}

body.dragging handle {
    cursor: unset;
}

.canvas-holder .overlay {
    position: absolute;
    top: 0;
    left: 0;
    color: white;
    font-weight: bold;
    font-size: 4rem;
    /* padding: 2rem; */

    text-shadow: 0 4px 5px rgba(70, 30, 200, 0.2), 0 2px 2px rgba(27, 9, 87, 0.5);
}

svg {
    display: block;
}

.equation {
    margin: 3rem auto;
    max-width: 100%;
}

.compiler-error {
    padding: 2rem;
    background-color: #7C3935;
    border-radius: 1rem;
    display: flex;
}

.runtime-warning {
    padding: 2rem;
    background-color: #694384;
    border-radius: 1rem;
    display: flex;
}

.compiler-error img,
.runtime-warning img {
    width: 27px;
    height: 26px;
    margin-top: 3px;
    margin-right: 12px;
}

@media (max-width: 1199px) {
    .compiler-error img,
    .runtime-warning img {
        width: calc(27px * 0.75);
        height: calc(26px * 0.75);
    }
}

.compiler-error p,
.runtime-warning p {
    color: white;
}

footer {
    grid-column: full;
    padding-bottom: 25rem;
    /* background-color: var(--secondary); */
}

footer>* {
    grid-column: main;
}
