*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --background: #09060f;
    --surface: #110b1a;
    --surface-hover: #181024;

    --text: #f5efff;
    --text-muted: #b8a9c9;

    --border: #382449;

    --accent: #b56cff;
    --accent-hover: #d09aff;

    --grid-purple: rgba(95, 31, 156, 0.25);
    --grid-violet: rgba(138, 0, 216, 0.5);
    --grid-size-purple: 80px;
    --grid-size-violet: 84px;
    --grid-weight: 2px;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--surface);
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface);
    border-left: 1px solid var(--border);
}

::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

body {
    background-color: var(--background);
    color: var(--text);

    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Oxygen,
        Ubuntu,
        Cantarell,
        "Open Sans",
        "Helvetica Neue",
        sans-serif;

    min-height: 100vh;
    padding: 2rem;
    margin: 0;

    position: relative;
    overflow-x: hidden;
}

body::before {
    content: "";

    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    z-index: -2;

    pointer-events: none;

    background-image:
        linear-gradient(
            to right,
            var(--grid-purple) var(--grid-weight),
            transparent var(--grid-weight)
        ),
        linear-gradient(
            to bottom,
            var(--grid-purple) var(--grid-weight),
            transparent var(--grid-weight)
        );

    background-size: var(--grid-size-purple) var(--grid-size-purple);
    animation: driftDownRight 1.5s linear infinite;
}

/* Grid: Up Left */
body::after {
    content: "";

    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    z-index: -1;

    pointer-events: none;

    background-image:
        linear-gradient(
            to right,
            var(--grid-violet) var(--grid-weight),
            transparent var(--grid-weight)
        ),
        linear-gradient(
            to bottom,
            var(--grid-violet) var(--grid-weight),
            transparent var(--grid-weight)
        );

    background-size: var(--grid-size-violet) var(--grid-size-violet);
    background-position: 25px 40px;
    animation: driftUpLeft 2s linear infinite;
}

@keyframes driftDownRight {
    from {
        background-position: 0 0;
    }

    to {
        background-position: var(--grid-size-purple) var(--grid-size-purple);
    }
}

@keyframes driftUpLeft {
    from {
        background-position: 0 0;
    }

    to {
        background-position: calc(var(--grid-size-violet) * -1)
            calc(var(--grid-size-violet) * -1);
    }
}

header {
    padding: 8px 24px;
    margin-bottom: 32px;

    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

a {
    display: inline-block;

    color: var(--accent);
    border-bottom: 1px solid transparent;

    text-decoration: none;

    transition:
        color 150ms ease,
        border-color 150ms ease,
        transform 150ms ease;
}

a:hover {
    color: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: scale(1.05);
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;

    padding: 32px 20px;
}

section {
    background: color-mix(in srgb, var(--surface) 88%, transparent);

    border: 1px solid var(--border);
    border-radius: 8px;

    padding: 4px 32px 20px;

    max-width: 900px;
}

article {
    background: color-mix(in srgb, var(--surface) 44%, transparent);

    border: 1px solid var(--border);
    border-radius: 8px;

    padding: 4px 32px 20px;

    max-width: 900px;

    margin-bottom: 20px;
}

section,
article {
    width: min(100%, 900px);
}

.two-column {
    display: flex;
    align-items: center;
    gap: 40px;
}

.two-column > div:first-child {
    flex: 1;
}

.two-column > div:last-child {
    flex-shrink: 0;

    display: flex;
    flex-direction: column;
    align-items: center;

    text-align: center;
}

.two-column > div:last-child img {
    display: block;

    width: 180px;
    height: auto;
}

button {
    font: inherit;

    background-color: var(--background);
    color: var(--text);

    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.75rem 1rem;

    transition:
        border-color 150ms ease,
        transform 150ms ease;
}

button:hover {
    border-color: var(--accent-hover);
    transform: scale(0.95);
}

input {
    display: inline-block;

    field-sizing: content;
    min-inline-size: 10ch;
    max-inline-size: 40ch;
    padding: 0.75rem 0.9rem;

    font: inherit;

    background-color: var(--background);
    color: var(--text);

    border: 1px solid var(--border);
    border-radius: 4px;

    transition:
        border-color 150ms ease,
        transform 150ms ease;
}

input:hover {
    border-color: var(--accent-hover);
    transform: scale(1.025);
}

input:focus {
    outline: none;
    border-color: var(--accent-hover);
}

dl {
    display: grid;
    grid-template-columns: minmax(120px, 200px) 1fr;

    border: 1px solid var(--border);
    border-radius: 8px;

    overflow: hidden;

    margin-top: 12px;
}

dt,
dd {
    margin: 0;
    padding: 12px 16px;
}

dt {
    font-weight: 600;
    background: var(--surface);
}

dd {
    border-left: 1px solid var(--border);
}

dt:not(:first-of-type),
dd:not(:first-of-type) {
    border-top: 1px solid var(--border);
}

iframe {
    display: block;

    width: min(100%, 560px);
    aspect-ratio: 16 / 9;
    height: auto;
    margin-inline: auto;

    border: 2px solid var(--accent);

    transition:
        transform 150ms ease,
        border-color 150ms ease;
}

iframe:hover {
    transform: scale(1.025);
    border-color: var(--accent-hover);
}

footer {
    background: var(--background);
    border-top: 1px solid var(--border);

    padding: 20px;

    text-align: center;
}

@media (max-width: 820px) {
    body {
        padding: 1.25rem 1rem;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 8px 0;
    }

    nav {
        flex-wrap: wrap;
        gap: 10px 14px;
    }

    main {
        padding-inline: 0;
    }

    .two-column {
        flex-direction: column;
        gap: 20px;
    }

    .two-column > div:last-child {
        width: 100%;
    }

    .two-column > div:last-child img {
        width: clamp(140px, 42vw, 220px);
    }
}

@media (max-width: 560px) {
    body {
        padding: 0.875rem 0.75rem;
    }

    h1 {
        font-size: clamp(2.2rem, 10vw, 3rem);
    }

    h2 {
        font-size: clamp(1.5rem, 7vw, 2rem);
    }

    nav {
        gap: 8px 12px;
    }

    nav a {
        font-size: 0.92rem;
    }

    section {
        padding: 16px 16px 18px;
    }

    input,
    button {
        width: 100%;
        max-width: 100%;
        min-height: 44px;
    }

    dl {
        grid-template-columns: 1fr;
    }

    dt,
    dd {
        border-left: none;
    }

    dd {
        border-top: 1px solid var(--border);
    }

    iframe {
        width: 100%;
    }

    footer {
        padding: 16px 12px;
    }
}
