:root {
    --bg: #f6f3fb;
    --surface: #ffffff;
    --surface-soft: #eee8fa;

    --text: #17151f;
    --muted: #686577;

    --accent: #7f63c9;
    --accent-soft: #bea7f3;

    --border: #d8cfee;

    --content-width: 900px;
}

[data-theme="dark"] {
    --bg: #0d0b16;
    --surface: #151221;
    --surface-soft: #211a35;

    --text: #eeeef2;
    --muted: #a29caf;

    --accent: #bea7f3;
    --accent-soft: #8ea6ff;

    --border: #33294d;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;

    background: var(--bg);

    color: var(--text);

    font-family: system-ui, sans-serif;
    line-height: 1.6;
}

header,
main,
footer {
    width: min(100% - 32px, var(--content-width));
    margin-inline: auto;
}

header {
    padding: 24px 0;

    border-bottom: 1px solid var(--border);
}

header > a {
    display: inline-block;
    margin-bottom: 16px;

    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
}

nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    line-height: 1.2;
    cursor: pointer;
}

.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.theme-toggle img {
    display: block;
}

a {
    color: var(--text);
}

a:hover {
    color: var(--accent);
}

main {
    padding: 48px 0;
}

section {
    margin-bottom: 48px;
}

h1 {
    margin-top: 0;
    margin-bottom: 16px;

    color: var(--accent);

    font-size: clamp(2.3rem, 12vw, 4.5rem);
    line-height: 1.05;
}

h2 {
    margin-top: 0;
    margin-bottom: 20px;

    color: var(--accent);
}

h3 {
    margin-top: 0;
    color: var(--accent);
}

h4 {
    margin-top: 0;
    color: var(--text)
}

p {
    max-width: 650px;

    color: var(--muted);
}

article {
    padding: 20px;

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

    box-shadow: 0 4px 20px rgb(0 0 0 / 5%);
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.image-grid img {
    display: block;
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
}

footer {
    padding: 24px 0;

    border-top: 1px solid var(--border);
    color: var(--muted);
}

body,
article,
header,
footer {
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

/* Tablet and larger */
@media (min-width: 700px) {
    header {
        display: flex;
        justify-content: space-between;
        align-items: center;

        padding: 28px 0;
    }

    header > a {
        margin-bottom: 0;
    }

    main {
        padding: 72px 0;
    }

    section {
        margin-bottom: 72px;
    }

    article {
        padding: 24px;
    }
}

@media (max-width: 700px) {
    .image-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 701px) and (max-width: 980px) {
    .image-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}