:root {
    color-scheme: light dark;
    --bg: #fafaf7;
    --fg: #1c1c1a;
    --muted: #6b6b66;
    --accent: #b5502e;
    --rule: #e2e2dc;
    --dot: rgba(28, 28, 26, 0.1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #161614;
        --fg: #ecece7;
        --muted: #9a9a94;
        --accent: #e0805c;
        --rule: #2a2a27;
        --dot: rgba(236, 236, 231, 0.1);
    }
}

:root[data-theme="light"] {
    color-scheme: light;
    --bg: #fafaf7;
    --fg: #1c1c1a;
    --muted: #6b6b66;
    --accent: #b5502e;
    --rule: #e2e2dc;
    --dot: rgba(28, 28, 26, 0.1);
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #161614;
    --fg: #ecece7;
    --muted: #9a9a94;
    --accent: #e0805c;
    --rule: #2a2a27;
    --dot: rgba(236, 236, 231, 0.1);
}

/* Faint dot grid behind the home page, fading out from the top center. */
.dots::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: radial-gradient(circle, var(--dot) 1.5px, transparent 2px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 0%, transparent 100%);
    mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 0%, transparent 100%);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--fg);
    font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 18px;
    line-height: 1.6;
}

header,
main,
footer {
    width: 100%;
    max-width: 40rem;
    margin: 0 auto;
    padding: 0 1.5rem;
}

header {
    padding-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: block;
    line-height: 0;
}

.logo img {
    height: 40px;
    width: auto;
}

/* Light/dark logo and icon variants: show the one matching the active theme. */
.logo .on-dark,
.theme-toggle .moon {
    display: none;
}

:root[data-theme="dark"] .logo .on-light,
:root[data-theme="dark"] .theme-toggle .sun {
    display: none;
}

:root[data-theme="dark"] .logo .on-dark,
:root[data-theme="dark"] .theme-toggle .moon {
    display: inline;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .logo .on-light,
    :root:not([data-theme="light"]) .theme-toggle .sun {
        display: none;
    }

    :root:not([data-theme="light"]) .logo .on-dark,
    :root:not([data-theme="light"]) .theme-toggle .moon {
        display: inline;
    }
}

.theme-toggle {
    all: unset;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--muted);
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    color: var(--accent);
    background: var(--rule);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

main {
    flex: 1;
    padding-top: 3rem;
    padding-bottom: 3rem;
}

h1,
h2 {
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

h1 {
    font-size: 2rem;
    margin: 0 0 1rem;
}

h2 {
    font-size: 1.25rem;
    margin: 2rem 0 0.5rem;
}

.hero {
    font-family: "Workbench", "Courier New", monospace;
    font-weight: 400;
    font-size: clamp(2rem, 6vw, 3rem);
    letter-spacing: 0;
}

.lead {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 1.5rem;
}

.muted {
    color: var(--muted);
}

a {
    color: var(--accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.15em;
}

ul {
    padding-left: 1.25rem;
}

footer {
    border-top: 1px solid var(--rule);
    padding-top: 1.25rem;
    padding-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--muted);
}

footer nav {
    display: flex;
    gap: 1.25rem;
}

footer a {
    color: inherit;
}

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