/* Shared by every article under /writing — keep both pages on this sheet so
   they stay typographically identical. */
*,
        *::before,
        *::after {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        :root {
            --bg: #FFFFFF;
            --text-primary: #1A1A1A;
            --text-secondary: #D1D1D1;
            --text-muted: #999999;
            --accent: #566b00;
            --sidebar-w: 300px;
            --font-main: "Neue Haas Grotesk Display Pro", "Neue Haas Grotesk", "Inter", sans-serif;
            --font-serif: "Source Serif 4", serif;
        }

        body {
            background: var(--bg);
            color: var(--text-primary);
            font-family: var(--font-main);
            -webkit-font-smoothing: antialiased;
            overflow: hidden;
        }

        .layout-wrapper {
            display: flex;
            height: 100vh;
            width: 100vw;
        }

        /* ─── MAIN CONTENT ─── */
        .scroll-container {
            flex: 1;
            margin-left: var(--sidebar-w);
            height: 100vh;
            overflow-y: auto;
            scroll-behavior: smooth;
        }

        main {
            display: flex;
            justify-content: center;
            padding: 80px 40px 120px 40px;
        }

        /* The scroll area starts after the fixed sidebar, so centring inside it
           lands half a sidebar right of the true screen centre. Pad the right
           by the sidebar width to pull the column back to the viewport centre —
           only once there is room for the full 540px column plus gutters. */
        @media (min-width: 1220px) {
            main {
                padding-right: calc(40px + var(--sidebar-w));
            }
        }

        .article-wrapper {
            max-width: 540px;
            width: 100%;
            display: flex;
            flex-direction: column;
            gap: 48px;
        }

        .article-header h1 {
            font-size: 16px;
            font-weight: 500;
            margin-bottom: 4px;
            color: var(--text-primary);
        }

        .article-subtitle {
            font-size: 14px;
            color: var(--text-primary);
            margin-bottom: 4px;
        }

        .article-date {
            font-size: 12px;
            color: var(--text-secondary);
        }

        .article-body {
            font-family: var(--font-serif);
            font-size: 16px;
            line-height: 1.6;
            color: var(--text-primary);
            display: flex;
            flex-direction: column;
            gap: 24px;
        }

        /* Book / section headings sit in the sans face against the serif body,
           with extra room above so each one opens a clear block. The rule runs
           from the heading out to the column edge, centred on its line box —
           same treatment as the case-study sections. */
        .article-body h2 {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-top: 24px;
            scroll-margin-top: 96px;
            font-family: var(--font-main);
            font-size: 16px;
            font-weight: 500;
            line-height: 1.35;
            letter-spacing: -0.01em;
            color: var(--text-primary);
        }

        .article-body h2::after {
            content: "";
            flex: 1;
            margin-left: 8px;
            height: 1px;
            background: rgba(0, 0, 0, 0.08);
        }

        /* Titles link out to Goodreads. They keep the heading colour so the
           underline is the only cue, and pick up the accent on hover. */
        .article-body h2 a {
            color: inherit;
            text-decoration-color: var(--text-secondary);
        }

        .article-body h2 a:hover {
            color: var(--accent);
        }

        .article-body h2 .article-author {
            color: var(--text-muted);
            font-weight: 400;
        }

        .article-body a {
            color: var(--accent);
            text-decoration: underline;
            text-underline-offset: 2px;
        }

        @media (max-width: 767px) {
            .article-body {
                padding-bottom: 40px;
            }
        }

        /* Break between the last book and the closing thoughts. */
        .article-break {
            margin: 24px 0;
            text-align: center;
            color: var(--text-muted);
        }

        /* ─── SIDEBAR INDEX ─── */
        /* Sits between the back link and the clock row; margin-bottom:auto eats
           the free space so the list hugs the top while nav-bottom stays pinned. */
        .article-index {
            width: 168px;
            margin-top: 32px;
            margin-bottom: auto;
            list-style: none;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .article-index a {
            display: inline-block;
            color: var(--text-muted);
            font-size: 14px;
            line-height: 1.35;
            text-decoration: none;
            transition: color 0.2s ease, transform 0.2s ease;
        }

        .article-index a:hover {
            color: var(--text-primary);
            transform: translateX(8px);
        }

        .article-index a.is-active {
            color: var(--text-primary);
        }

        @media (max-width: 767px) {
            /* The sidebar collapses to a single back-link row on mobile, so the
               index has nowhere to sit. */
            .article-index {
                display: none;
            }
        }
