@font-face {
    font-family: 'N27';
    src: url('../assets/fonts/n27-bold-webfont.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'N27';
    src: url('../assets/fonts/n27-regular-webfont.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'N27';
    src: url('../assets/fonts/n27-light-webfont.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'N27';
    src: url('../assets/fonts/n27-extralight-webfont.woff2') format('woff2');
    font-weight: 200;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'Atkinson Hyperlegible Mono';
    src: url('../assets/fonts/atkinson-hyperlegible-mono-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'Atkinson Hyperlegible Mono';
    src: url('../assets/fonts/atkinson-hyperlegible-mono-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: block;
}

:root {
    color-scheme: dark light;
    --ground: rgb(10, 12, 16);
    --ink: rgb(229, 231, 234);
    --title-ink: rgb(229, 231, 234);
    --brand-ink: rgb(200, 255, 255);
    --hover-ink: rgb(143, 220, 255);
    --spine: calc(7vw + 20px);
    --mono: 'Atkinson Hyperlegible Mono', monospace;
}

@media (prefers-color-scheme: light) {
    :root {
        --ground: rgb(238, 242, 246);
        --ink: rgb(22, 30, 27);
        --title-ink: rgb(22, 30, 27);
        --brand-ink: rgb(22, 30, 27);
        --hover-ink: rgb(24, 50, 68);
    }
}

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

html {
    background: var(--ground);
    scroll-behavior: smooth;
    scrollbar-width: none;
}

html::-webkit-scrollbar { display: none; }

body {
    min-width: 320px;
    min-height: 100vh;
    overflow-x: clip;
    background: var(--ground);
    color: var(--ink);
    font-family: 'N27', sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
    text-decoration: none;
}

a:focus-visible {
    outline: 2px solid var(--hover-ink);
    outline-offset: 7px;
}

.mono {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    line-height: 1.35;
    text-transform: uppercase;
}

.scratchpad-frame {
    position: absolute;
    z-index: 2;
    top: 38px;
    left: var(--spine);
    right: var(--spine);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    pointer-events: none;
}

.scratchpad-frame > * { pointer-events: auto; }

.site-mark {
    display: block;
    width: 30px;
    color: var(--brand-ink);
}

.site-mark svg {
    display: block;
    width: 100%;
    height: auto;
}

.scratchpad-nav {
    display: flex;
    align-items: baseline;
    gap: clamp(24px, 3vw, 44px);
}

.scratchpad-nav a:hover,
.scratchpad-nav a:focus-visible,
.site-mark:hover,
.site-mark:focus-visible,
.entry-title a:hover,
.entry-title a:focus-visible,
.read-entry:hover,
.read-entry:focus-visible,
.article-parent:hover,
.article-parent:focus-visible {
    color: var(--hover-ink);
}

.scratchpad-intro {
    width: min(34rem, calc(100% - 2 * var(--spine)));
    margin-inline: auto;
    padding-top: clamp(126px, 15vh, 174px);
    text-align: center;
}

.scratchpad-description {
    margin-top: 22px;
    font-family: var(--mono);
    font-size: clamp(13px, 1vw, 16px);
    font-weight: 400;
    letter-spacing: 0.075em;
    line-height: 1.7;
}

.featured-entry {
    margin-top: clamp(104px, 15vh, 168px);
    padding-inline: var(--spine);
    text-align: center;
}

.entry-header {
    width: min(56rem, 100%);
    margin-inline: auto;
}

.entry-date { display: block; }

.entry-title,
.article-title {
    margin-top: 30px;
    color: var(--title-ink);
    font-family: 'N27', sans-serif;
    font-size: clamp(2.75rem, 4.4vw, 4.1rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 0.88;
    text-transform: uppercase;
    text-wrap: balance;
}

.entry-title {
    max-width: 54rem;
    margin-inline: auto;
}

.entry-deck,
.article-deck {
    margin: 24px auto 0;
    font-family: var(--mono);
    font-size: clamp(13px, 1vw, 16px);
    font-weight: 400;
    letter-spacing: 0.045em;
    line-height: 1.65;
}

.entry-image-link {
    position: relative;
    display: block;
    width: min(900px, 100%);
    aspect-ratio: 2.55 / 1;
    margin: clamp(38px, 5vh, 58px) auto 0;
    overflow: clip;
    background: var(--ink);
}

.entry-image-link::after,
.article-hero::after {
    content: '';
    position: absolute;
    z-index: 1;
    inset: 0;
    pointer-events: none;
    background: rgba(8, 28, 52, 0.28);
    mix-blend-mode: multiply;
}

.entry-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center bottom;
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.image-credential {
    position: absolute;
    z-index: 2;
    right: 10px;
    bottom: 10px;
    padding: 5px 7px;
    background: rgba(10, 12, 16, 0.56);
    color: rgba(255, 255, 255, 0.76);
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0.05em;
    line-height: 1;
    pointer-events: none;
}

.read-entry {
    display: block;
    width: max-content;
    margin: 28px auto 0;
    font-family: var(--mono);
    font-size: 13px;
    font-style: italic;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.older-notes {
    min-height: 22vh;
    padding: clamp(92px, 13vh, 150px) var(--spine) 64px;
    text-align: center;
}

.older-notes h2 { font-weight: 400; }

/* Article shell: deliberately shares the index's calm centered opening. */
.article-page {
    padding: clamp(150px, 18vh, 210px) var(--spine) clamp(100px, 14vh, 160px);
}

.article-header {
    width: min(58rem, 100%);
    margin-inline: auto;
    text-align: center;
}

.article-title {
    max-width: 58rem;
    margin-inline: auto;
}

.article-parent {
    display: block;
    width: max-content;
    margin: 0 auto clamp(74px, 10vh, 110px);
}

.article-hero {
    position: relative;
    width: min(980px, 100%);
    aspect-ratio: 16 / 8.5;
    margin: clamp(62px, 8vh, 92px) auto 0;
    overflow: clip;
}

.article-hero img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.article-body {
    width: min(43rem, 100%);
    margin: clamp(64px, 9vh, 104px) auto 0;
    font-size: clamp(17px, 1.2vw, 20px);
    font-weight: 200;
    letter-spacing: 0.035em;
    line-height: 1.7;
}

.article-body p + p,
.article-body h2 + p { margin-top: 1.25em; }

.article-body h2 {
    margin-top: 3.75em;
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.14em;
    line-height: 1.4;
    text-transform: uppercase;
}

.article-body blockquote {
    margin: clamp(56px, 8vh, 88px) auto;
    color: var(--title-ink);
    font-size: clamp(1.6rem, 3vw, 2.5rem);
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.25;
    text-align: center;
    text-wrap: balance;
}

.article-credit {
    margin-top: clamp(82px, 12vh, 130px);
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.045em;
    line-height: 1.65;
}

.article-aside {
    margin-top: 3.5em !important;
    font-style: italic;
}

@media (prefers-color-scheme: light) {
    .scratchpad-description,
    .entry-deck,
    .article-deck,
    .read-entry,
    .older-notes h2 { font-weight: 700; }

    .article-body { font-weight: 300; }

    .entry-image-link::after,
    .article-hero::after {
        background: rgba(78, 114, 140, 0.18);
    }
}

@media (hover: hover) and (pointer: fine) {
    .entry-image-link:hover .entry-image,
    .entry-image-link:focus-visible .entry-image {
        transform: scale(1.012);
    }
}

@media (max-width: 700px) {
    .scratchpad-frame { top: 28px; }

    .site-mark { width: 25px; }

    .scratchpad-nav {
        gap: clamp(13px, 4.5vw, 24px);
        font-size: 10px;
        letter-spacing: 0.1em;
    }

    .scratchpad-intro {
        padding-top: clamp(128px, 19vh, 162px);
    }

    .scratchpad-description {
        margin-top: 18px;
        font-size: 13px;
        line-height: 1.65;
    }

    .featured-entry {
        margin-top: clamp(96px, 16vh, 132px);
    }

    .entry-title,
    .article-title {
        margin-top: 24px;
        font-size: clamp(2rem, 8.8vw, 3.25rem);
        line-height: 0.96;
    }

    .entry-deck,
    .article-deck {
        margin-top: 20px;
        font-size: 13px;
    }

    .entry-image-link {
        aspect-ratio: 4 / 3;
        margin-top: 42px;
    }

    .read-entry { margin-top: 24px; }

    .older-notes {
        min-height: 20vh;
        padding-top: 104px;
        padding-bottom: 44px;
    }

    .article-page {
        padding-top: 132px;
        padding-bottom: 90px;
    }

    .article-parent { margin-bottom: 82px; }

    .article-hero {
        aspect-ratio: 4 / 3;
        margin-top: 52px;
    }

    .image-credential {
        right: 7px;
        bottom: 7px;
        font-size: 8px;
    }

    .article-body {
        margin-top: 58px;
        font-size: 17px;
        line-height: 1.65;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .entry-image { transition: none; }
}
