/* Hello there, fellow nerd.
   I keep things pretty simple in here.
   Have fun poking around. */

/************** CSS RESET **************/

/* 1. Use a more-intuitive box-sizing model */
*, *::before, *::after {
  box-sizing: border-box;
}

/* 2. Remove default margin */
*:not(dialog) {
  margin: 0;
}

/* 3. Enable keyword animations */
@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

body {
  /* 4. Increase line-height */
  line-height: 1.5;
  /* 5. Improve text rendering */
  -webkit-font-smoothing: antialiased;
}

/* 6. Improve media defaults */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

/* 7. Inherit fonts for form controls */
input, button, textarea, select {
  font: inherit;
}

/* 8. Avoid text overflows */
p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

/* 9. Improve line wrapping */
p {
  text-wrap: pretty;
}
h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
}

/*
  10. Create a root stacking context
*/
#root, #__next {
  isolation: isolate;
}

/************** FONTS **************/

@font-face {
    font-family: "JacquardaBastarda9";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: local(""), url("/fonts/JacquardaBastarda9-Regular.ttf") format("truetype");
}

/************** SITE **************/

:root {
    --bright-white: #ffffff;
    --nice-red: #ed1c24;
    --nice-blue: blue;
    --heading-font: "JacquardaBastarda9", Courier New, Courier, Menlo, monospace;
    --body-font: Menlo, Courier New, Courier, monospace;
}

body {
    max-width: 1200px;
    margin: 4rem auto 2rem auto;
    font-size: 16px;
    line-height: 1.8rem;
    font-family: var(--body-font);
    background-color: #ffffff;
}

main {
    padding: 4rem;
    border: 10px dashed var(--nice-red);
    border-radius: 1rem;
    clear: both;
}

h1 {
    display: inline-block;
    padding: 2rem;
    font-size: 3rem;
    background-color: #eeeeee;
    border-radius: 4rem;
    letter-spacing: 2px;
    margin-bottom: 2rem;
    
    a {
        text-decoration: none;
        color: #000;

        &:hover {
            color: #000;
            background: none;
        }
    }

    .protocol {
        color: #ccc;
    }
}

@keyframes wave {
    0%,90% {
        transform: rotate(0deg);
    }
    90%, 100% {
        transform: rotate(20deg);
    }
}

.wave {
    display: inline-block;
    animation-duration: 2s;
    animation-name: wave;
    animation-iteration-count: infinite;
    animation-direction: alternate;
}

#profile {
    width: 200px;
    height: 200px;
    border-radius: 200px;
    margin-left: 1rem;
    float: right;
    border: 1rem solid #000;
    padding: 1rem;
    transition: transform ease-in-out 0.2s;
    box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;

    &:hover {
        transform: scale(130%) rotate(10deg);
    }
}

section {
    margin-bottom: 4rem;

    &.highlight {
        padding: 0;
        font-family: var(--heading-font);
        font-weight: bold;
        font-size: 4rem;
        line-height: 5rem;
        margin: 0 0 5rem 0;
        padding-bottom: 4rem;
        border-bottom: 10px dashed #000;
    }

    &:last-child {
        margin-bottom: 0;
    }

    &.contrast {
        background-color: #000;
        color: var(--bright-white);
        padding: 4rem;
        border-radius: 1rem;
    }
}

h1, h2 {
    font-family: var(--heading-font);
}

h2 {
    margin-bottom: 2rem;
    font-size: 3rem;
    line-height: 3rem;
}

h3 {
    font-size: 1.5rem;
    line-height: 1.5rem;
    font-family: var(--heading-font);
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--nice-blue);
    font-weight: bold;
    text-decoration: none;

    &:hover {
        background-color: var(--nice-blue);
        color: var(--bright-white);
    }
}

ul, ol {
    padding-left: 0;

    li {
        margin-bottom: 2rem;
    }
}

ol {
    padding-left: 1rem;

    li {
        padding-left: 1rem;
    }

    li::marker {
        font-family: var(--heading-font);
        font-size: 1.5rem;
        color: #333;
    }
}

ul {
    list-style-type: square;
}

.examples {
    list-style-type: none;
    padding-left: 0;

    h3 {
        font-family: var(--body-font);

        &:before {
            content: "☞ ";
        }
    }
}

form {
    margin: 0 auto;

    input[type="text"] {
        width: 100%;
        border-radius: 1em;
        padding: 1rem;
        background-color: #ddd;
        border: none;
    }

    label {
        display: block;
        margin: 2rem 0;
    }

    textarea {
        width: 100%;
        height: 10rem;
        padding: 1rem;
        background-color: #ddd;
        border-radius: 1em;
        border: none;
    }

    button {
        margin-top: 1rem;;
        width: 100%;
        padding: 1rem;
        background-color: #ddd;
        border-radius: 1em;
        border: none;

        &:hover {
            cursor: pointer;
        }
    }
}

footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.9rem;
    color: #666;

    a {
        font-weight: normal;
    }

    p {
        margin: 0;
    }
}

@media screen and (max-width: 600px) {
    body {
        margin-top: 2rem;
    }
    
    h1 {
        font-size: 1rem;
        padding: 1rem;
        display: block;
        text-align: center;
        margin-left: 1rem;
        margin-right: 1rem;
    }

    h2 {
        font-size: 3rem;
        line-height: 3rem;
    }

    h3 {
        font-size: 1.4rem;
        line-height: 1.4rem;
    }

    main {
        border-radius: 0;
        padding: 2rem;
        border: none;
    }

    section {
        padding: 0;

        &.highlight {
            font-size: 2rem;
            line-height: 2rem;
        }

        &.contrast {
            padding: 2rem 1rem;
        }

        &:last-child {
            padding-bottom: 1rem;
        }
    }

    #profile {
        float: none;
        display: block;
        margin: 0 auto;
        margin-bottom: 2rem;

        &:hover {
            transform: none;
        }
    }

    form {
        font-size: 0.8rem;
        
        label {
            margin-bottom: 0.1rem;
        }
    }

    footer {
        font-size: 0.7rem;
        padding: 0 1rem;
    }
}