*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #f0eee6;
    --text: #1f1e1d;
    --font: 'Newsreader', Georgia, 'Times New Roman', serif;
    color-scheme: light dark;
}

[data-theme="dark"] {
    --bg: #1f1e1d;
    --text: #f0eee6;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 20px;
    line-height: 1.6;
    transition: color 0.3s ease, background-color 0.3s ease;
}

::selection {
    background: rgba(0, 100, 255, 0.26);
    color: inherit;
}

a {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.3s ease;
}

a:hover {
    opacity: 0.6;
}

/* ——— Header ——— */

header {
    max-width: 620px;
    margin: 0 auto;
    padding: 15px 20px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 28px;
    font-weight: 600;
    line-height: 1.2;
}

header h1 a {
    text-decoration: none !important;
}

/* ——— Theme Toggle (pill slider) ——— */

.toggle-wrap {
    display: flex;
    align-items: center;
}

.toggle-wrap input {
    display: none;
}

.toggle-wrap label {
    position: relative;
    display: block;
    width: 40px;
    height: 20px;
    background: var(--text);
    border-radius: 10px;
    cursor: pointer;
}

.toggle-wrap label::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: var(--bg);
    border-radius: 50%;
    transition: transform 0s;
}

.toggle-wrap label.has-transition::after {
    transition: transform 0.2s;
}

.toggle-wrap input:checked + label::after {
    transform: translateX(20px);
}

/* ——— Main Content ——— */

main {
    max-width: 620px;
    margin: 0 auto;
    padding: 0 20px;
}

article section {
    margin-top: 26px;
}

article section:first-child {
    margin-top: 2rem;
}

article section p {
    margin-bottom: 1rem;
}

article section p:last-child {
    margin-bottom: 0;
}

h2 {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

ul {
    list-style: none;
}

ul li {
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 0.9em;
}

ul li::before {
    content: '•';
    position: absolute;
    left: 0;
}

ul li:last-child {
    margin-bottom: 0;
}

/* ——— Footer ——— */

footer {
    max-width: 620px;
    margin: 0 auto;
    padding: 3rem 20px 2rem;
}

footer p {
    font-size: 14px;
    opacity: 0.5;
}

/* ——— Responsive ——— */

@media (max-width: 768px) {
    body {
        font-size: 18px;
    }

    header h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 21px;
    }
}

/* ——— Reduced Motion ——— */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
    }
}
