@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=IBM+Plex+Mono:wght@500;600&family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
    color-scheme: light;
    --note-paper: #f3f0e7;
    --note-surface: #fffefa;
    --note-ink: #10251e;
    --note-muted: #626b65;
    --note-line: rgba(16, 37, 30, 0.14);
    --note-green: #0b5d49;
    --note-coral: #f26745;
    --note-serif: "Fraunces", Georgia, serif;
    --note-sans: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --note-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 0;
    min-height: 100vh;
    color: var(--note-ink);
    background:
        radial-gradient(circle at 10% 2%, rgba(242, 103, 69, 0.1), transparent 22rem),
        radial-gradient(circle at 92% 4%, rgba(11, 93, 73, 0.1), transparent 24rem),
        var(--note-paper);
    font-family: var(--note-sans);
    font-size: 1rem;
    line-height: 1.72;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

::selection {
    color: #fffefa;
    background: var(--note-green);
}

img,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: var(--note-green);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
}

a:hover {
    color: #c9462b;
}

:focus-visible {
    outline: 3px solid var(--note-coral);
    outline-offset: 4px;
}

.page {
    width: min(900px, calc(100% - 2rem));
    max-width: none;
    margin: 0 auto;
    padding: 1.5rem 0 5rem;
}

.top-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin: 0 0 1.5rem;
    padding: 0.65rem 1rem;
    border: 1px solid var(--note-line);
    border-radius: 999px;
    color: var(--note-ink);
    background: rgba(255, 254, 250, 0.78);
    font-family: var(--note-sans);
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
}

.top-link:hover {
    color: #fffefa;
    background: var(--note-green);
}

header,
article,
footer {
    width: 100%;
    max-width: none;
}

header {
    margin: 0 0 2rem;
    padding: clamp(2rem, 7vw, 5rem) 0 clamp(1.8rem, 4vw, 3rem);
    border: 0;
    border-bottom: 1px solid var(--note-line);
    border-radius: 0;
    color: var(--note-ink);
    background: transparent;
    box-shadow: none;
}

header h1,
h1 {
    max-width: 14ch;
    margin: 0 0 1.25rem;
    color: var(--note-ink);
    font-family: var(--note-serif);
    font-size: clamp(3.1rem, 7vw, 6.7rem);
    font-weight: 600;
    letter-spacing: -0.06em;
    line-height: 0.94;
    text-wrap: balance;
}

.meta {
    color: var(--note-muted);
    font-family: var(--note-mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

article {
    padding: clamp(1.5rem, 6vw, 4.5rem);
    border: 1px solid var(--note-line);
    border-radius: 28px;
    color: var(--note-ink);
    background: var(--note-surface);
    box-shadow: 0 22px 65px rgba(16, 37, 30, 0.08);
}

article > :first-child {
    margin-top: 0;
}

article > :last-child {
    margin-bottom: 0;
}

article h2,
h2 {
    max-width: 22ch;
    margin: clamp(2.6rem, 6vw, 4.8rem) 0 1rem;
    color: var(--note-ink);
    font-family: var(--note-serif);
    font-size: clamp(1.9rem, 4vw, 3rem);
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1.05;
    text-wrap: balance;
}

article h3,
h3 {
    margin: 2rem 0 0.8rem;
    color: var(--note-ink);
    font-family: var(--note-sans);
    font-size: 1.08rem;
    line-height: 1.35;
}

article p,
article ul,
article ol,
article blockquote {
    max-width: 72ch;
    margin: 0 0 1.2rem;
}

article p,
article li {
    color: #263b33;
}

article ul,
article ol {
    padding-left: 1.35rem;
}

article li + li {
    margin-top: 0.75rem;
}

article strong {
    color: var(--note-ink);
}

article a {
    overflow-wrap: anywhere;
}

article blockquote {
    margin-left: 0;
    padding: 1.25rem 1.4rem;
    border-left: 4px solid var(--note-coral);
    border-radius: 0 12px 12px 0;
    background: rgba(242, 103, 69, 0.08);
}

article code {
    padding: 0.15em 0.35em;
    border-radius: 5px;
    background: rgba(11, 93, 73, 0.09);
    font-family: var(--note-mono);
    font-size: 0.88em;
}

article pre {
    max-width: 100%;
    overflow-x: auto;
    padding: 1rem;
    border-radius: 12px;
    color: #fffefa;
    background: var(--note-ink);
}

article pre code {
    padding: 0;
    color: inherit;
    background: transparent;
}

footer {
    margin: 1.5rem 0 0;
    padding: 1.5rem 0 0;
    border: 0;
    border-top: 1px solid var(--note-line);
    border-radius: 0;
    color: var(--note-muted);
    background: transparent;
    box-shadow: none;
    font-size: 0.9rem;
}

/* Compatibility for the three earliest notes that already used shared site markup. */
.page-article .site-shell {
    width: min(900px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.5rem 0 5rem;
}

.page-article .topbar {
    display: none;
}

.page-article .site-main {
    display: grid;
    gap: 1.5rem;
}

.page-article .article-hero .panel {
    padding: clamp(2rem, 7vw, 5rem) 0 clamp(1.8rem, 4vw, 3rem);
    border: 0;
    border-bottom: 1px solid var(--note-line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.page-article .back-link {
    display: inline-flex;
    margin-bottom: 2rem;
    color: var(--note-green);
    font-weight: 700;
}

.page-article .article-hero h1 {
    max-width: 14ch;
}

.page-article .meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin-top: 1.5rem;
    color: var(--note-muted);
    font-family: var(--note-mono);
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.page-article .article-card .callout {
    display: block;
    margin: 1.8rem 0;
    padding: 1.2rem 1.35rem;
    border: 0;
    border-left: 4px solid var(--note-coral);
    border-radius: 0 12px 12px 0;
    color: var(--note-ink);
    background: rgba(242, 103, 69, 0.08);
}

.page-article .panel--tint {
    padding: clamp(1.5rem, 5vw, 3rem);
    border-radius: 24px;
    color: #fffefa;
    background: #073c30;
}

.page-article .panel--tint .panel-title {
    margin: 0 0 1rem;
    color: #fffefa;
    font-family: var(--note-serif);
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1;
}

.page-article .panel--tint .panel-copy {
    max-width: 62ch;
    color: rgba(255, 255, 255, 0.72);
}

.page-article .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 999px;
    color: #fffefa;
    font-weight: 700;
    text-decoration: none;
}

.page-article .btn-primary {
    color: var(--note-ink);
    border-color: #fffefa;
    background: #fffefa;
}

@media (max-width: 640px) {
    .page {
        width: min(100% - 1rem, 900px);
        padding-top: 0.75rem;
    }

    .top-link {
        margin-bottom: 0.75rem;
    }

    header {
        padding: 2.5rem 0 1.75rem;
    }

    header h1,
    h1 {
        font-size: clamp(2.8rem, 15vw, 4.3rem);
    }

    article {
        padding: 1.35rem;
        border-radius: 20px;
    }

    article h2,
    h2 {
        margin-top: 2.8rem;
        font-size: 2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}
