/*
 * demonjic.com: the decision log.
 *
 * Osirion.Blazor renders the site with its own design system (no CSS framework). This file sets the site's tokens on
 * top of Osirion's and styles the few site components. Osirion's stylesheets load after this one, so every rule here
 * is anchored on html.dd to win on specificity instead of on order.
 */

/* ========== Type ========== */

@font-face {
    font-family: "Schibsted Grotesk";
    font-style: normal;
    font-display: swap;
    font-weight: 400 900;
    src: url("fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Schibsted Grotesk";
    font-style: normal;
    font-display: swap;
    font-weight: 400 900;
    src: url("fonts/schibsted-grotesk-latin-ext-wght-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Literata";
    font-style: normal;
    font-display: swap;
    font-weight: 400;
    src: url("fonts/literata-latin-400-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Literata";
    font-style: normal;
    font-display: swap;
    font-weight: 400;
    src: url("fonts/literata-latin-ext-400-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Literata";
    font-style: italic;
    font-display: swap;
    font-weight: 400;
    src: url("fonts/literata-latin-400-italic.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Literata";
    font-style: italic;
    font-display: swap;
    font-weight: 400;
    src: url("fonts/literata-latin-ext-400-italic.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Literata";
    font-style: normal;
    font-display: swap;
    font-weight: 600;
    src: url("fonts/literata-latin-600-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Literata";
    font-style: normal;
    font-display: swap;
    font-weight: 600;
    src: url("fonts/literata-latin-ext-600-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "JetBrains Mono";
    font-style: normal;
    font-display: swap;
    font-weight: 400;
    src: url("fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "JetBrains Mono";
    font-style: normal;
    font-display: swap;
    font-weight: 400;
    src: url("fonts/jetbrains-mono-latin-ext-400-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "JetBrains Mono";
    font-style: normal;
    font-display: swap;
    font-weight: 500;
    src: url("fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "JetBrains Mono";
    font-style: normal;
    font-display: swap;
    font-weight: 500;
    src: url("fonts/jetbrains-mono-latin-ext-500-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ========== Tokens ========== */

/* Osirion sets its light tokens on :root[data-osirion-theme=light]; the second selector outranks that, and the dark
   block below, written later with the same weight, outranks this one. */
html.dd,
html.dd[data-osirion-theme] {
    color-scheme: light;

    --dd-paper: #FFFFFF;
    --dd-paper-2: #F3F4F6;
    --dd-surface: #FFFFFF;
    --dd-ink: #16181D;
    --dd-graphite: #5B6270;
    --dd-rule: #E4E6EA;
    --dd-signal: #8F5200;
    --dd-signal-mark: #F2B13C;

    --dd-font-display: "Schibsted Grotesk", "Segoe UI", system-ui, sans-serif;
    --dd-font-text: "Literata", Georgia, "Times New Roman", serif;
    --dd-font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

    --dd-page: 72rem;
    --dd-measure: 40rem;
    --dd-gutter: 9.5rem;
    --dd-pad: clamp(1rem, 4vw, 2.5rem);

    /* Osirion's semantic tokens, mapped to the site palette. */
    --osirion-background-primary: var(--dd-paper);
    --osirion-background-secondary: var(--dd-paper-2);
    --osirion-background-tertiary: var(--dd-paper-2);
    --osirion-text-primary: var(--dd-ink);
    --osirion-text-secondary: var(--dd-graphite);
    --osirion-text-tertiary: var(--dd-graphite);
    --osirion-border-color: var(--dd-rule);
    --osirion-border-color-hover: var(--dd-graphite);
    --osirion-action-primary: var(--dd-signal);
    --osirion-action-primary-hover: var(--dd-ink);
    --osirion-action-primary-text: var(--dd-paper);
    --osirion-color-primary-600: var(--dd-signal);
    --osirion-color-primary-700: var(--dd-ink);
    --osirion-card-background: var(--dd-surface);
    --osirion-card-border-color: var(--dd-rule);
    --osirion-font-family-base: var(--dd-font-display);
    --osirion-font-family-mono: var(--dd-font-mono);
    --osirion-reading-progress-color: var(--dd-signal-mark);
    --osirion-primary-color: var(--dd-ink);
    --osirion-link-primary: var(--dd-ink);
    --osirion-link-bg: transparent;
    --osirion-anchor-offset: 5.5rem;
    /* With a unit: Osirion adds it to lengths inside calc(), where a bare 0 makes the whole value invalid. */
    --osirion-menu-padding-x: 0px;
    /* Osirion's own focus rings (the skip link's among them) in the site's accent. */
    --osirion-focus-ring-color: var(--dd-signal-mark);
    --osirion-focus-ring-width: 2px;
    --osirion-content-index-gap: 0;

    --dd-radius: 0.875rem;
    --dd-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
    --dd-shadow-hover: 0 12px 28px -12px rgba(16, 24, 40, 0.22);
}

html.dd[data-osirion-theme="dark"] {
    color-scheme: dark;

    --dd-paper: #0D0F13;
    --dd-paper-2: #1B1F27;
    --dd-surface: #14171D;
    --dd-ink: #E9EBEF;
    --dd-graphite: #9DA5B2;
    --dd-rule: #272B34;
    --dd-signal: #F2B13C;
    --dd-signal-mark: #F2B13C;

    --osirion-action-primary-text: var(--dd-paper);
    --osirion-primary-color: var(--dd-signal);
}

/* ========== Base ========== */

html.dd body {
    margin: 0;
    background: var(--dd-paper);
    color: var(--dd-ink);
    font-family: var(--dd-font-display);
    font-size: 1rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

html.dd ::selection {
    background: var(--dd-signal-mark);
    color: #12151B;
}

html.dd :focus-visible {
    outline: 2px solid var(--dd-signal);
    outline-offset: 3px;
}

html.dd a {
    color: inherit;
    text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 0.2em;
}

html.dd a:hover {
    text-decoration-color: var(--dd-signal-mark);
}

.dd-wrap {
    box-sizing: border-box;
    width: 100%;
    max-width: var(--dd-page);
    margin-inline: auto;
    padding-inline: var(--dd-pad);
}

.dd-eyebrow,
.dd-label {
    font-family: var(--dd-font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--dd-graphite);
}

/* A section opens with its name and a quiet rule across the page. */
.dd-section {
    margin-block: clamp(3rem, 7vw, 5.5rem);
}

.dd-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.875rem;
    border-bottom: 1px solid var(--dd-rule);
}

.dd-section-title {
    margin: 0;
    font-family: var(--dd-font-display);
    font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.75rem);
    font-weight: 750;
    letter-spacing: -0.02em;
}

.dd-section-link {
    display: inline-block;
    padding-block: 0.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--dd-graphite);
}

.dd-section-link::after {
    content: " \2192";
}

.dd-section-link:hover {
    color: var(--dd-ink);
}

/* ========== Home: the thesis ========== */

.dd-hero {
    padding-block: clamp(3.5rem, 9vw, 7.5rem) clamp(1rem, 3vw, 2rem);
}

.dd-thesis {
    margin: 1.25rem 0 0;
    max-width: 18em;
    font-family: var(--dd-font-display);
    font-size: clamp(2.25rem, 1.2rem + 4.4vw, 4.75rem);
    font-weight: 750;
    line-height: 1.02;
    letter-spacing: -0.035em;
    text-wrap: balance;
}

/* The one accent on the page: the part of the sentence the site exists for. */
.dd-mark {
    background-image: linear-gradient(var(--dd-signal-mark), var(--dd-signal-mark));
    background-repeat: no-repeat;
    background-size: 100% 0.16em;
    background-position: 0 92%;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

.dd-intro {
    max-width: var(--dd-measure);
    margin: 1.75rem 0 0;
    font-family: var(--dd-font-text);
    font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
    line-height: 1.65;
    color: var(--dd-graphite);
}

.dd-now {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 0.75rem;
    align-items: baseline;
    max-width: var(--dd-measure);
    margin: 2rem 0 0;
    padding: 0.875rem 1rem;
    border: 1px solid var(--dd-rule);
    border-left: 3px solid var(--dd-signal-mark);
    background: var(--dd-surface);
    font-family: var(--dd-font-text);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.dd-now-label {
    font-family: var(--dd-font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--dd-signal);
}

.dd-hero-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.75rem;
    margin: 2rem 0 0;
    padding: 0;
    list-style: none;
    font-weight: 600;
}

.dd-hero-links a {
    display: inline-block;
    padding-block: 0.375rem;
}

/* ========== The log: posts and work as entries ========== */

.dd-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.dd-entry {
    display: grid;
    grid-template-columns: var(--dd-gutter) minmax(0, 1fr);
    column-gap: 2rem;
    padding-block: 1.5rem;
    border-bottom: 1px solid var(--dd-rule);
}

.dd-entry-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-top: 0.3rem;
    font-family: var(--dd-font-mono);
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--dd-graphite);
    font-variant-numeric: tabular-nums;
}

.dd-entry-format {
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--dd-graphite);
}

.dd-entry-title {
    margin: 0;
    font-family: var(--dd-font-display);
    font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: -0.015em;
    text-wrap: balance;
}

.dd-entry-title a {
    text-decoration: none;
}

.dd-entry-title a:hover {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--dd-signal-mark);
    text-decoration-thickness: 3px;
}

.dd-entry-summary {
    max-width: var(--dd-measure);
    margin: 0.5rem 0 0;
    font-family: var(--dd-font-text);
    line-height: 1.6;
    color: var(--dd-graphite);
}

.dd-entry-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin: 0.75rem 0 0;
    padding: 0;
    list-style: none;
    font-family: var(--dd-font-mono);
    font-size: 0.75rem;
    color: var(--dd-graphite);
}

.dd-entry-facts a {
    display: inline-block;
    padding-block: 0.25rem;
}

.dd-empty {
    padding-block: 1.5rem;
    font-family: var(--dd-font-text);
    color: var(--dd-graphite);
}

@media (max-width: 40rem) {
    .dd-entry {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 0.5rem;
    }

    .dd-entry-meta {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.75rem;
        padding-top: 0;
    }
}

/* ========== Article: the record header and the prose ========== */

.dd-record-head {
    padding-block: clamp(2.5rem, 6vw, 4.5rem) 0;
}

.dd-record-crumb {
    margin: 0;
}

.dd-record-crumb a {
    text-decoration: none;
}

.dd-record-title {
    max-width: 20em;
    margin: 1rem 0 0;
    font-family: var(--dd-font-display);
    font-size: clamp(2rem, 1.3rem + 3vw, 3.5rem);
    font-weight: 750;
    line-height: 1.05;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

.dd-record-lede {
    max-width: var(--dd-measure);
    margin: 1.25rem 0 0;
    font-family: var(--dd-font-text);
    font-size: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem);
    line-height: 1.55;
    color: var(--dd-graphite);
}

.dd-record {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: 1rem 2rem;
    margin: 2rem 0 0;
    padding-block: 1rem;
    border-block: 1px solid var(--dd-rule);
}

.dd-record div {
    margin: 0;
}

.dd-record dt {
    font-family: var(--dd-font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--dd-graphite);
}

.dd-record dd {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    margin: 0.25rem 0 0;
    font-family: var(--dd-font-mono);
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
}

/* WCAG 2.5.8: each link in the record is at least 24px tall, with room around it for a finger. */
.dd-record dd a {
    display: inline-block;
    padding-block: 0.375rem;
}

/* Long-form text. Osirion's own content typography is scoped and does not reach rendered Markdown (Osirion.Blazor
   issue 122), so the site sets it here. */
html.dd .osirion-html-renderer {
    font-family: var(--dd-font-text);
    font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.15rem);
    line-height: 1.75;
    color: var(--dd-ink);
}

html.dd .osirion-html-renderer > * {
    max-width: var(--dd-measure);
}

html.dd .osirion-html-renderer :is(h2, h3, h4) {
    font-family: var(--dd-font-display);
    letter-spacing: -0.015em;
    line-height: 1.2;
    text-wrap: balance;
}

html.dd .osirion-html-renderer h2 {
    margin: 2.75rem 0 0.75rem;
    font-size: 1.625rem;
    font-weight: 700;
}

html.dd .osirion-html-renderer h3 {
    margin: 2rem 0 0.5rem;
    font-size: 1.25rem;
    font-weight: 650;
}

html.dd .osirion-html-renderer :is(p, ul, ol, blockquote) {
    margin: 0 0 1.25rem;
}

html.dd .osirion-html-renderer li + li {
    margin-top: 0.375rem;
}

/* Osirion draws content links as inline-block pills with an external-link icon, no underline and a lift on hover. In
   running text a link is text: it wraps with the line, keeps the paragraph's weight, and is told apart by its
   underline in the accent colour. */
html.dd .osirion-html-renderer a {
    display: inline;
    position: static;
    padding: 0;
    border-radius: 0;
    background: none;
    color: var(--dd-ink);
    font-weight: inherit;
    text-decoration: underline;
    text-decoration-color: var(--dd-signal);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
    transition: text-decoration-color 150ms ease;
}

html.dd .osirion-html-renderer a::after {
    content: none;
}

html.dd .osirion-html-renderer a:hover {
    background: none;
    color: var(--dd-ink);
    box-shadow: none;
    transform: none;
    text-decoration-color: var(--dd-signal-mark);
    text-decoration-thickness: 2px;
}

html.dd .osirion-html-renderer a:focus-visible {
    border-radius: 0.125rem;
    box-shadow: none;
    outline: 2px solid var(--dd-signal-mark);
    outline-offset: 2px;
}

/* Lists keep the text measure with their indent inside it, so their right edge meets the paragraphs'. */
html.dd .osirion-html-renderer :is(ul, ol) {
    box-sizing: border-box;
    max-width: var(--dd-measure);
}

html.dd .osirion-html-renderer blockquote {
    padding-left: 1.25rem;
    border-left: 3px solid var(--dd-signal-mark);
    color: var(--dd-graphite);
    font-style: italic;
}

html.dd .osirion-html-renderer :not(pre) > code {
    display: inline;
    padding: 0.1em 0.3em;
    border: 0;
    border-radius: 0.25rem;
    background: var(--dd-paper-2);
    font-family: var(--dd-font-mono);
    /* Never below 12px, inside a small table cell included. */
    font-size: max(0.85em, 0.75rem);
}

/* Wide code and tables scroll inside the text column; a keyboard reaches them, so the focus shows. */
html.dd .osirion-html-renderer :is(pre, table):focus-visible {
    outline: 2px solid var(--dd-signal-mark);
    outline-offset: 2px;
}

/* Code is dark in both themes: the syntax highlighter's token colours are drawn for a dark ground, and on the light
   paper they washed out. It keeps the text measure, so code and prose share both edges. */
html.dd .osirion-html-renderer pre {
    box-sizing: border-box;
    max-width: var(--dd-measure);
    margin: 1.75rem 0;
    padding: 1.125rem 1.25rem;
    overflow-x: auto;
    border: 1px solid #2A2E37;
    border-radius: 0.375rem;
    background: #14161B;
    color: #E6E8EC;
    font-family: var(--dd-font-mono);
    font-size: 0.875rem;
    line-height: 1.6;
}

/* ========== Osirion components, in the site's voice ========== */

/* Header: the page's own paper with one rule, not a floating card. */
html.dd .osirion-page-header {
    background: color-mix(in srgb, var(--dd-paper) 92%, transparent);
    -webkit-backdrop-filter: saturate(140%) blur(8px);
    backdrop-filter: saturate(140%) blur(8px);
    border-bottom: 1px solid var(--dd-rule);
}

html.dd .osirion-menu-container {
    box-sizing: border-box;
    max-width: var(--dd-page);
    margin-inline: auto;
    padding-inline: var(--dd-pad);
    border-bottom: 0;
    background: transparent;
    box-shadow: none;
}

/* The page padding lives on the container, so the menu toggle keeps the same inset as the brand. */
html.dd .osirion-navbar-toggle {
    right: var(--dd-pad);
}

/* The Rebla mark is drawn black on transparent; in the dark theme it is turned white, in the header and the footer. */
html.dd[data-osirion-theme="dark"] .osirion-brand-logo,
html.dd[data-osirion-theme="dark"] .osirion-footer img[src$="logo.png"] {
    filter: invert(1);
}

html.dd .osirion-brand-text {
    font-family: var(--dd-font-display);
    font-weight: 700;
    letter-spacing: -0.01em;
}

html.dd .osirion-menu-item {
    border: 0;
    border-radius: 0;
    background: transparent;
    font-weight: 500;
    color: var(--dd-graphite);
    box-shadow: inset 0 -2px 0 transparent;
}

html.dd .osirion-menu-item:hover:not(.osirion-menu-item-disabled) {
    background: transparent;
    color: var(--dd-ink);
}

html.dd .osirion-menu-item-active {
    background: transparent;
    color: var(--dd-ink);
    box-shadow: inset 0 -2px 0 var(--dd-signal-mark);
}

/* About: the same opening as a record, on the page grid. */
html.dd .osirion-about-page {
    box-sizing: border-box;
    max-width: var(--dd-page);
    margin-inline: auto;
    padding: clamp(2.5rem, 6vw, 4.5rem) var(--dd-pad) 5rem;
}

html.dd .osirion-page-heading-title {
    max-width: 20em;
    margin: 0;
    font-family: var(--dd-font-display);
    font-size: clamp(2.25rem, 1.5rem + 3vw, 3.75rem);
    font-weight: 750;
    line-height: 1.02;
    letter-spacing: -0.035em;
}

html.dd .osirion-page-heading-description {
    max-width: var(--dd-measure);
    margin: 1.25rem 0 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--dd-rule);
    font-family: var(--dd-font-text);
    font-size: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem);
    line-height: 1.55;
    color: var(--dd-graphite);
}

/* Not found: an entry that is missing, set like any other record instead of a centred error card. */
html.dd .dd-not-found {
    box-sizing: border-box;
    max-width: var(--dd-page);
    margin-inline: auto;
    padding: clamp(2.5rem, 6vw, 4.5rem) var(--dd-pad) 5rem;
}

html.dd .dd-not-found .osirion-content-not-found {
    align-items: flex-start;
    max-width: none;
    margin: 0;
    padding: 0;
    text-align: left;
    background: transparent;
    border: 0;
    box-shadow: none;
}

html.dd .dd-not-found .osirion-content-not-found-icon {
    display: none;
}

html.dd .dd-not-found .osirion-content-not-found-code {
    font-family: var(--dd-font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--dd-signal);
}

html.dd .dd-not-found .osirion-content-not-found-title {
    margin: 1rem 0 0;
    font-family: var(--dd-font-display);
    font-size: clamp(2.25rem, 1.5rem + 3vw, 3.75rem);
    font-weight: 750;
    line-height: 1.02;
    letter-spacing: -0.035em;
}

html.dd .dd-not-found .osirion-content-not-found-message {
    max-width: var(--dd-measure);
    margin: 1.25rem 0 0;
    font-family: var(--dd-font-text);
    font-size: 1.125rem;
    color: var(--dd-graphite);
}

html.dd .dd-not-found .osirion-content-not-found-suggestions {
    box-sizing: border-box;
    width: 100%;
    max-width: var(--dd-measure);
    margin-top: 2.5rem;
    padding: 0.75rem 0 0;
    border-top: 1px solid var(--dd-rule);
    text-align: left;
}

html.dd .dd-not-found .osirion-content-not-found-suggestions-title {
    text-align: left;
    font-family: var(--dd-font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--dd-graphite);
}

html.dd .dd-not-found .osirion-content-not-found-suggestions-list {
    display: flex;
    max-width: var(--dd-measure);
    margin: 0;
    padding: 0;
    list-style: none;
    gap: 0;
}

html.dd .dd-not-found .osirion-content-not-found-suggestion-item {
    padding-block: 1rem;
    border-bottom: 1px solid var(--dd-rule);
}

html.dd .dd-not-found .osirion-content-not-found-suggestion-link {
    font-family: var(--dd-font-display);
    font-size: 1.25rem;
    font-weight: 650;
    color: var(--dd-ink);
}

html.dd .dd-not-found .osirion-content-not-found-actions {
    justify-content: flex-start;
    margin-top: 2rem;
}

/* Buttons: ink on paper, the accent only as the focus and hover underline. */
html.dd .osirion-button-primary {
    border: 1px solid var(--dd-ink);
    border-radius: 0.375rem;
    background: var(--dd-ink);
    color: var(--dd-paper);
}

html.dd .osirion-button-primary:hover:not(:disabled) {
    background: transparent;
    color: var(--dd-ink);
}

/* Lists: the page title, then the log. */
html.dd .osirion-content-list-page {
    box-sizing: border-box;
    max-width: var(--dd-page);
    margin-inline: auto;
    padding: clamp(2.5rem, 6vw, 4.5rem) var(--dd-pad) 4rem;
}

html.dd .osirion-content-list-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--dd-rule);
}

html.dd .osirion-content-list-title {
    margin: 0;
    font-family: var(--dd-font-display);
    font-size: clamp(2.25rem, 1.5rem + 3vw, 3.75rem);
    font-weight: 750;
    letter-spacing: -0.035em;
    line-height: 1.02;
}

html.dd .osirion-content-list-description {
    max-width: var(--dd-measure);
    margin: 1rem 0 0;
    font-family: var(--dd-font-text);
    font-size: 1.125rem;
    color: var(--dd-graphite);
}

html.dd .osirion-content-list,
html.dd .osirion-content-list-page-main,
html.dd .osirion-featured-posts-section,
html.dd section:has(> .osirion-content-index) {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

html.dd .osirion-content-list-page-feed {
    margin-top: 1.5rem;
    font-family: var(--dd-font-mono);
    font-size: 0.8125rem;
}

/* Article layout: text column plus the table of contents in the gutter on wide screens. */
html.dd .osirion-article-page {
    box-sizing: border-box;
    max-width: var(--dd-page);
    margin-inline: auto;
    padding: 0 var(--dd-pad) 5rem;
}

html.dd .osirion-article-page-content {
    padding: 0;
    max-width: none;
}

html.dd .osirion-article-layout {
    margin-top: 2.5rem;
}

html.dd .osirion-sidebar-title {
    font-family: var(--dd-font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--dd-graphite);
}

html.dd .osirion-toc-link {
    color: var(--dd-graphite);
    font-size: 0.875rem;
    text-decoration: none;
}

html.dd .osirion-toc-link:hover {
    color: var(--dd-ink);
}

html.dd .osirion-sidebar-tag {
    border: 1px solid var(--dd-rule);
    border-radius: 0;
    background: transparent;
    color: var(--dd-graphite);
    font-family: var(--dd-font-mono);
    font-size: 0.75rem;
}

/* The author note after the article. */
html.dd .osirion-article-author {
    max-width: var(--dd-measure);
    margin-top: 3.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--dd-rule);
}

html.dd .osirion-author-card {
    border: 0;
    background: transparent;
    padding: 0;
}

html.dd .osirion-author-card-name {
    font-weight: 700;
}

html.dd .osirion-author-card-bio {
    font-family: var(--dd-font-text);
    color: var(--dd-graphite);
}

html.dd .osirion-author-card-initials {
    background: var(--dd-ink);
    color: var(--dd-paper);
    font-family: var(--dd-font-mono);
}

/* The theme toggle: a plain square in the page's ink instead of a floating disc. Osirion sets its shadow and border
   with !important, so these two answer the same way. */
html.dd[data-osirion-theme] .theme-toggle-btn {
    border-radius: 0.375rem;
    background: transparent;
    color: var(--dd-ink);
    border-color: var(--dd-rule) !important;
    box-shadow: none !important;
}

html.dd .theme-toggle-btn::before {
    display: none;
}

/* The table of contents is the gutter's index: its rule is the accent, not a brand blue. */
html.dd .osirion-sidebar-title {
    border-bottom: 1px solid var(--dd-signal-mark);
}

/* Footer: the page's own grid on a quieter band, set in the text face like the rest of the page. */
html.dd .osirion-footer {
    background: var(--dd-paper-2);
    border-top: 1px solid var(--dd-rule);
    color: var(--dd-graphite);
}

html.dd .osirion-footer-main {
    max-width: var(--dd-page);
    margin-inline: auto;
    padding: 3rem var(--dd-pad) 2rem;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    grid-template-areas: "left middle";
    gap: 2.5rem;
}

html.dd .osirion-footer-main-left-content,
html.dd .osirion-footer-main-middle-content {
    padding: 0;
    border: 0;
}

html.dd .osirion-footer-main-right-content:empty {
    display: none;
}

html.dd .osirion-footer-description {
    max-width: 22rem;
    margin-top: 0.75rem;
    font-family: var(--dd-font-text);
    color: var(--dd-graphite);
}

html.dd .osirion-footer-grid {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 2rem;
}

html.dd .osirion-footer-section-title {
    margin-bottom: 0.75rem;
    font-family: var(--dd-font-display);
    font-size: 0.875rem;
    font-weight: 650;
    letter-spacing: 0;
    text-transform: none;
    color: var(--dd-ink);
}

html.dd .osirion-footer-link {
    display: inline-block;
    padding-block: 0.2rem;
    color: var(--dd-graphite);
    text-decoration: none;
}

html.dd .osirion-footer-link:hover {
    color: var(--dd-ink);
    text-decoration: underline;
    text-decoration-color: var(--dd-signal-mark);
}

html.dd .osirion-footer-social-link {
    border: 1px solid var(--dd-rule);
    border-radius: 999px;
    background: var(--dd-surface);
    color: var(--dd-ink);
}

html.dd .osirion-footer-social-link:hover {
    border-color: var(--dd-ink);
}

html.dd .osirion-footer-divider {
    display: none;
}

html.dd .osirion-footer-bottom-content {
    padding: 0;
    justify-content: flex-start;
}

/* The closing rule runs on the content's edges, like the section rules above it. */
html.dd .osirion-footer-bottom {
    box-sizing: border-box;
    width: calc(100% - 2 * var(--dd-pad));
    max-width: calc(var(--dd-page) - 2 * var(--dd-pad));
    margin-inline: auto;
    padding: 1.25rem 0 2.5rem;
    border-top: 1px solid var(--dd-rule);
    font-family: var(--dd-font-display);
    font-size: 0.8125rem;
}

@media (max-width: 48rem) {
    html.dd .osirion-footer-main {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "left" "middle";
    }

    html.dd .osirion-footer-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ========== Cards: the log as a grid of covers ========== */

.dd-cards,
html.dd ol.osirion-content-index:has(.dd-card) {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

html.dd ol.osirion-content-index:has(.dd-card) > li {
    margin: 0;
    padding: 0;
    border: 0;
}

.dd-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
    overflow: hidden;
    border: 1px solid var(--dd-rule);
    border-radius: var(--dd-radius);
    background: var(--dd-surface);
    box-shadow: var(--dd-shadow);
    transition: box-shadow 200ms ease, transform 200ms ease, border-color 200ms ease;
}

.dd-card:hover {
    border-color: color-mix(in srgb, var(--dd-graphite) 35%, var(--dd-rule));
    box-shadow: var(--dd-shadow-hover);
    transform: translateY(-2px);
}

.dd-card-cover {
    display: block;
    aspect-ratio: 1200 / 630;
    overflow: hidden;
    background: var(--dd-paper-2);
}

.dd-card-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dd-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.625rem;
    padding: 1.125rem 1.25rem 1.25rem;
}

.dd-card-kicker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin: 0;
    font-size: 0.75rem;
    color: var(--dd-graphite);
}

.dd-pill {
    display: inline-block;
    padding: 0.125rem 0.625rem;
    border: 1px solid var(--dd-rule);
    border-radius: 999px;
    background: var(--dd-paper-2);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--dd-ink);
}

.dd-card .dd-entry-title {
    font-size: 1.1875rem;
    line-height: 1.25;
}

/* The whole card answers a click; the title stays the one link in the reading order. */
.dd-card .dd-entry-title a::after {
    content: "";
    position: absolute;
    inset: 0;
}

.dd-card .dd-entry-title a:hover {
    text-decoration: none;
}

.dd-card-summary {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--dd-graphite);
}

.dd-card-meta {
    display: flex;
    gap: 0.5rem;
    margin: auto 0 0;
    padding-top: 0.25rem;
    font-size: 0.8125rem;
    color: var(--dd-graphite);
    font-variant-numeric: tabular-nums;
}

/* The lead entry: wide, the cover beside the text where there is room. */
.dd-card-featured .dd-entry-title,
html.dd ol.osirion-content-index:has(.dd-card) > li:first-child .dd-entry-title {
    font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem);
    letter-spacing: -0.02em;
}

html.dd ol.osirion-content-index:has(.dd-card) > li:first-child {
    grid-column: 1 / -1;
}

@media (min-width: 64rem) {
    .dd-card-featured,
    html.dd ol.osirion-content-index:has(.dd-card) > li:first-child .dd-card {
        display: grid;
        grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    }

    /* The cover keeps its proportions (its text must not be cropped) and sits in a frame inside the card, so the
       space the text column leaves around it reads as a margin. */
    .dd-card-featured .dd-card-cover,
    html.dd ol.osirion-content-index:has(.dd-card) > li:first-child .dd-card-cover {
        align-self: center;
        margin: 1.25rem 0 1.25rem 1.25rem;
        border-radius: calc(var(--dd-radius) - 0.25rem);
    }

    .dd-card-featured .dd-card-body,
    html.dd ol.osirion-content-index:has(.dd-card) > li:first-child .dd-card-body {
        justify-content: center;
        padding: 2rem 2.25rem;
    }

    .dd-card-featured .dd-card-summary,
    html.dd ol.osirion-content-index:has(.dd-card) > li:first-child .dd-card-summary {
        -webkit-line-clamp: 5;
        line-clamp: 5;
        font-size: 1rem;
    }

    .dd-card-featured .dd-card-meta,
    html.dd ol.osirion-content-index:has(.dd-card) > li:first-child .dd-card-meta {
        margin-top: 0.5rem;
    }
}

/* ========== Home: buttons, series, work ========== */

.dd-button {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    box-sizing: border-box;
    padding: 0 1.25rem;
    border: 1px solid var(--dd-rule);
    border-radius: 999px;
    background: var(--dd-surface);
    font-weight: 600;
    text-decoration: none;
    color: var(--dd-ink);
}

.dd-button:hover {
    border-color: var(--dd-graphite);
}

html.dd .dd-button-primary {
    border-color: var(--dd-ink);
    background: var(--dd-ink);
    color: var(--dd-paper);
}

html.dd .dd-button-primary:hover {
    background: color-mix(in srgb, var(--dd-ink) 85%, var(--dd-paper));
    color: var(--dd-paper);
}

.dd-series {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 12.5rem), 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.dd-series-link {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    height: 100%;
    box-sizing: border-box;
    padding: 1.125rem 1.25rem;
    border: 1px solid var(--dd-rule);
    border-radius: var(--dd-radius);
    background: var(--dd-surface);
    text-decoration: none;
    transition: border-color 200ms ease;
}

.dd-series-link:hover {
    border-color: var(--dd-graphite);
}

.dd-series-name {
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.dd-series-count {
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--dd-graphite);
}

.dd-work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
    gap: 1rem;
}

.dd-work-grid .dd-entry {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    row-gap: 0.375rem;
    height: 100%;
    box-sizing: border-box;
    padding: 1.25rem;
    border: 1px solid var(--dd-rule);
    border-radius: var(--dd-radius);
    background: var(--dd-surface);
}

@media (prefers-reduced-motion: reduce) {
    .dd-card,
    .dd-series-link {
        transition: none;
    }

    .dd-card:hover {
        transform: none;
    }
}

/* ========== Contact: a plain form on the text measure ========== */

.dd-contact-email {
    max-width: var(--dd-measure);
    margin: 1.25rem 0 0;
    font-size: 1.0625rem;
}

.dd-contact-form {
    display: grid;
    gap: 1.25rem;
    max-width: var(--dd-measure);
    margin-bottom: clamp(3rem, 7vw, 5.5rem);
}

.dd-contact-form[hidden] {
    display: none;
}

.dd-field {
    display: grid;
    gap: 0.375rem;
}

.dd-field label {
    font-family: var(--dd-font-display);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--dd-ink);
}

.dd-field input,
.dd-field textarea {
    box-sizing: border-box;
    width: 100%;
    padding: 0.75rem 0.875rem;
    border: 1px solid color-mix(in srgb, var(--dd-graphite) 40%, var(--dd-rule));
    border-radius: 0.5rem;
    background: var(--dd-surface);
    color: var(--dd-ink);
    font-family: var(--dd-font-text);
    font-size: 1rem;
    line-height: 1.5;
}

.dd-field textarea {
    min-height: 10rem;
    resize: vertical;
}

.dd-field input:focus-visible,
.dd-field textarea:focus-visible {
    border-color: var(--dd-ink);
    outline: 2px solid var(--dd-signal-mark);
    outline-offset: 1px;
}

/* Out of sight and out of the reading order; only a bot fills it. */
.dd-trap {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* The widget's own height, held before it loads so the button does not jump. */
.dd-turnstile {
    min-height: 65px;
}

.dd-contact-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
}

button.dd-button {
    cursor: pointer;
    font-family: var(--dd-font-display);
    font-size: 1rem;
}

button.dd-button:disabled {
    cursor: progress;
    opacity: 0.6;
}

.dd-contact-status {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--dd-graphite);
}

.dd-contact-status[data-state="sent"] {
    color: var(--dd-ink);
    font-weight: 600;
}

.dd-contact-privacy {
    max-width: var(--dd-measure);
    margin: 0;
    font-size: 0.875rem;
    color: var(--dd-graphite);
}

/* ========== Article furniture: the series box and the previous/next pair keep the text measure ========== */

html.dd .osirion-series-nav,
html.dd .osirion-content-navigation {
    box-sizing: border-box;
    max-width: var(--dd-measure);
}

html.dd .osirion-series-nav-parts {
    font-family: var(--dd-font-display);
}

html.dd .osirion-series-nav-parts li::marker {
    color: var(--dd-graphite);
}

/* ========== Keyboard ========== */

/* One focus ring for the whole site, in the accent: Osirion's components each drew their own, some in its default
   blue. */
html.dd :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--dd-signal-mark);
    outline-offset: 2px;
}

/* The skip link is fixed at z-index 51 and the sticky header sits at 1000 with a frosted background, so a focused
   skip link showed only as a blur under the header. It comes above the header while it has focus. */
html.dd .osirion-skip-link:focus,
html.dd .osirion-skip-link:focus-visible {
    z-index: 1100;
    outline: 2px solid var(--dd-signal-mark);
    outline-offset: 2px;
}

/* The hidden checkbox behind the menu toggle drives the collapsed menu only. This site's menu collapses below
   1200px (Osirion's collapse-large); from there up the toggle is not drawn, and the checkbox was a focus stop with
   nothing on screen. */
@media (min-width: 1200px) {
    html.dd .osirion-menu-collapse-large .osirion-navbar-toggler {
        display: none;
    }
}

/* ========== Phone menu ========== */

/* Collapsed (below 1200px), the items are full-width rows: their text starts on the page's gutter, under the brand,
   and the current page is marked by a bar at the row's start instead of a rule across the whole row. */
@media (max-width: 1199.98px) {
    html.dd .osirion-menu-collapse-large .osirion-menu-item {
        padding-inline: var(--dd-pad);
        box-shadow: none;
    }

    html.dd .osirion-menu-collapse-large .osirion-menu-item-active {
        box-shadow: inset 3px 0 0 var(--dd-signal-mark);
    }
}
