:root {
    --background-color-light: #f3f1ec;
    --text-color-light: #262421;
    --text-soft-light: #55504a;
    --heading-color-light: #1d1b19;
    --rule-color-light: #979087;
    --link-color-light: #22201d;
    --link-hover-color-light: #151412;
    --focus-color-light: #1d1b19;
    --selection-color-light: #dbd6cd;
    --shadow-color-light: rgba(39, 35, 30, 0.14);
    --surface-color: #f7f4ee;
    --surface-muted: #ece8e1;
    --surface-border: #d2cbc1;

    --background-color-dark: #1b1916;
    --text-color-dark: #ddd8cf;
    --text-soft-dark: #b1aa9f;
    --heading-color-dark: #f0ebe2;
    --rule-color-dark: #6b655d;
    --link-color-dark: #ece5d9;
    --link-hover-color-dark: #ffffff;
    --focus-color-dark: #f0ebe2;
    --selection-color-dark: #403b34;
    --shadow-color-dark: rgba(0, 0, 0, 0.28);
}

@font-face {
    font-family: 'Berkeley Mono';
    src: url('/fonts/BerkeleyMono-Regular.woff2') format('woff2');
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Berkeley Mono';
    src: url('/fonts/BerkeleyMono-Oblique.woff2') format('woff2');
    font-style: italic;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Berkeley Mono';
    src: url('/fonts/BerkeleyMono-Bold.woff2') format('woff2');
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: 'Berkeley Mono';
    src: url('/fonts/BerkeleyMono-Bold-Oblique.woff2') format('woff2');
    font-style: italic;
    font-weight: 700;
    font-display: swap;
}

body {
    color: var(--text-color-light);
    background-color: var(--background-color-light);
    font-family: 'Berkeley Mono', monospace;
    font-size: 15px;
    line-height: 1.55;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s, color 0.3s
}

::selection {
    background-color: var(--selection-color-light);
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 18px 20px 24px;
}

.site-header {
    border-bottom: 1px solid color-mix(in srgb, var(--rule-color-light) 40%, transparent);
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5em;
    padding-top: 0.9em;
    padding-bottom: 0.9em;
}

.site-brand,
.site-nav a {
    text-decoration: none;
}

.site-brand {
    color: var(--heading-color-light);
    font-size: 0.95em;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9em;
}

.site-nav a {
    color: var(--text-soft-light);
    padding-bottom: 0.12em;
    border-bottom: 1px solid transparent;
}

.site-nav a:hover,
.site-nav a.is-active {
    color: var(--heading-color-light);
    border-bottom-color: color-mix(in srgb, var(--rule-color-light) 70%, transparent);
}

.page-shell {
    padding-top: 2.2em;
    padding-bottom: 3.5em;
}

.home-page .page-shell {
    padding-top: 1.1em;
}

.reading-page .page-shell {
    padding-top: 1.5em;
}

.page-header {
    margin-bottom: 2.6em;
}

.page-header h1 {
    margin-top: 0;
}

.page-header:not(.page-header-home) h1 {
    font-size: 2.9em;
    text-align: left;
}

h1 {
    color: var(--heading-color-light);
    font-size: 2.5em;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-align: center;
    margin-top: 0.5em;
    margin-bottom: 0.3em;
}

.subtitle {
    color: var(--text-soft-light);
    text-align: center;
    font-style: italic;
    font-size: 1.6em;
    margin-bottom: 1.9em;
}

.page-intro {
    max-width: 42em;
    color: var(--text-soft-light);
    margin: 0 auto;
    line-height: 1.55;
}

.page-header:not(.page-header-home) .page-intro {
    margin-left: 0;
}

h2, h3, h4, h5, h6 {
    color: var(--heading-color-light);
    font-weight: 700;
}

h2 {
    font-size: 2em;
    margin-top: 1.35em;
    margin-bottom: 0.5em;
    padding-bottom: 0.28em;
    border-bottom: 1px solid color-mix(in srgb, var(--rule-color-light) 78%, transparent);
}

h3 {
    font-size: 1.4em;
    margin-top: 1em;
    margin-bottom: 0.5em;
}

p {
    margin-top: 0.85em;
    margin-bottom: 0.85em;
    line-height: 1.6;
}

ul,
ol {
    margin: 0.85em 0 1em 1.5em;
}

li {
    margin-bottom: 0.35em;
}

a {
    color: var(--link-color-light);
    text-decoration-line: underline;
    text-decoration-thickness: 0.075em;
    text-underline-offset: 0.18em;
    text-decoration-color: color-mix(in srgb, var(--link-color-light) 65%, transparent);
    transition: color 0.2s ease, text-decoration-color 0.2s ease, text-decoration-thickness 0.2s ease;
}

a:hover {
    color: var(--link-hover-color-light);
    text-decoration-thickness: 0.12em;
    text-decoration-color: currentColor;
}

a:focus-visible {
    outline: 1px solid var(--focus-color-light);
    outline-offset: 0.16em;
    text-decoration-color: currentColor;
}

img {
    max-width: 100%;
    height: auto;
}

.awards-image-container {
    display: block;
    max-width: 90%;
    margin: 0 auto;
    text-align: center;
}

.awards-image-container img {
    width: 100%;
    height: auto;
    box-shadow: 0 10px 24px var(--shadow-color-light);
    border-radius: 10px;
}

.awards-image-container figcaption {
    font-size: 0.9em;
    margin-top: 1em;
    font-style: italic;
    color: var(--text-soft-light);
    line-height: 1.4;
    padding: 0.5em 0;
}

.conferences {
    list-style: none;
    padding-left: 0;
    margin-left: 2em;
}

.conferences li {
    text-indent: -1em;
    margin-left: 1em;
    margin-bottom: 0.22em;
    line-height: 1.35;
}

.conference {
    font-style: italic;
}

.book-section {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    margin-bottom: 2em;
}

.book-metadata {
    flex: 1;
    padding-right: 1em;
}

.book-cover-container {
    flex: 0 0 auto;
    margin-left: 1.25em;
}

.book-cover-container a {
    position: relative;
    display: inline-block;
    padding: 0.55em;
    border-radius: 8px;
    background: color-mix(in srgb, var(--background-color-light) 88%, #ffffff 12%);
    border: 1px solid color-mix(in srgb, var(--rule-color-light) 46%, transparent);
    box-shadow: 0 12px 24px color-mix(in srgb, var(--shadow-color-light) 62%, transparent);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.book-cover-container a::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.book-cover-container a:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px color-mix(in srgb, var(--shadow-color-light) 76%, transparent);
}

.metadata-entry {
    margin-bottom: 0.28em;
    line-height: 1.3;
}

.book-cover {
    display: block;
    height: 156px;
    width: auto;
    align-self: start;
    margin-left: 0;
    border-radius: 2px;
    box-shadow: 0 10px 18px color-mix(in srgb, var(--shadow-color-light) 78%, transparent);
}

.book-title {
    font-style: italic;
}

.metadata-entry .label {
    font-weight: 600;
}

.comment {
    margin-top: 0.65em;
}

.post-list {
    display: grid;
    gap: 1.25em;
}

.post-card {
    padding: 0 0 1.4em;
    border-bottom: 1px solid color-mix(in srgb, var(--rule-color-light) 40%, transparent);
}

.post-card:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.post-card-date,
.post-date,
.post-kicker {
    color: var(--text-soft-light);
    font-size: 0.95em;
}

.post-card h2,
.post-header h1 {
    border-bottom: 0;
    padding-bottom: 0;
}

.post-card h2 {
    font-size: 1.65em;
    margin-top: 0.2em;
    margin-bottom: 0.35em;
}

.post-card h2 a {
    text-decoration: none;
}

.post-card h2 a:hover {
    text-decoration: underline;
}

.post {
    max-width: 760px;
}

.post-header {
    margin-bottom: 2.2em;
}

.post-header h1 {
    font-size: 3.2em;
    text-align: left;
    margin-top: 0.2em;
    margin-bottom: 0.25em;
}

.post-intro {
    color: var(--text-soft-light);
    max-width: 38em;
}

.post-content h2 {
    margin-top: 1.7em;
}

.post-content h3 {
    margin-top: 1.2em;
}

.post-content blockquote {
    margin: 1.4em 0;
    padding: 0.15em 0 0.15em 1.2em;
    border-left: 1px solid color-mix(in srgb, var(--rule-color-light) 72%, transparent);
    color: var(--text-soft-light);
}

.post-content hr {
    border: 0;
    border-top: 1px solid color-mix(in srgb, var(--rule-color-light) 60%, transparent);
    margin: 2em 0;
}

.post-content table {
    width: 100%;
    margin: 1.2em 0;
}

.post-content th,
.post-content td {
    padding: 0.55em 0.7em;
    border: 1px solid color-mix(in srgb, var(--surface-border) 75%, transparent);
    text-align: left;
}

code,
pre {
    font-family: 'Berkeley Mono', monospace;
}

:not(pre) > code {
    padding: 0.14em 0.32em;
    border-radius: 4px;
    background: var(--surface-muted);
    border: 1px solid color-mix(in srgb, var(--surface-border) 72%, transparent);
    font-size: 0.94em;
}

.highlighter-rouge,
.highlight {
    margin: 1.1em 0 1.35em;
}

.highlighter-rouge {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.highlight {
    overflow-x: auto;
    padding: 1em 1.1em;
    border-radius: 6px;
    background: var(--surface-muted);
    border: 1px solid color-mix(in srgb, var(--surface-border) 55%, transparent);
}

.highlight pre {
    margin: 0;
    line-height: 1.55;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
}

.highlight code {
    background: transparent;
    border: 0;
    padding: 0;
    font-size: 0.95em;
}

.mjx-container {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.1em 0;
}

#client-testimonials blockquote {
    font-style: italic;
    color: var(--text-color-light);
    margin: 20px 0;
    padding: 0.35em 0 0.35em 20px;
    border-left: 1px solid var(--rule-color-light);
}

#client-testimonials .video-testimonial {
    margin: 20px 0;
    text-align: center;
}

#client-testimonials .video-testimonial video {
    width: 100%;
    max-width: 700px;
    height: auto;
    border-radius: 10px;
}

@media (max-width: 600px) {
    body {
        font-size: 14px;
    }

    .book-section {
        flex-direction: column;
    }

    .book-metadata {
        padding-right: 0;
    }

    .book-cover-container {
        order: -1;
        height: auto;
        width: 100%;
        margin-bottom: 1em;
        margin-left: 0;
    }

    .site-header-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .post-header h1 {
        font-size: 3.15em;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --surface-color: #25211d;
        --surface-muted: #211d1a;
        --surface-border: #4e4841;
    }

    body {
        color: var(--text-color-dark);
        background-color: var(--background-color-dark);
    }

    ::selection {
        background-color: var(--selection-color-dark);
    }

    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        color: var(--heading-color-dark);
    }

    .subtitle {
        color: var(--text-soft-dark);
    }

    .page-intro,
    .post-intro,
    .post-card-date,
    .post-date,
    .post-kicker,
    .post-content blockquote {
        color: var(--text-soft-dark);
    }

    h2 {
        border-bottom: 1px solid color-mix(in srgb, var(--rule-color-dark) 72%, transparent);
    }

    a {
        color: var(--link-color-dark);
        text-decoration-color: color-mix(in srgb, var(--link-color-dark) 55%, transparent);
    }

    a:hover {
        color: var(--link-hover-color-dark);
    }

    a:focus-visible {
        outline-color: var(--focus-color-dark);
    }

    .site-header {
        border-bottom-color: color-mix(in srgb, var(--rule-color-dark) 36%, transparent);
    }

    .site-brand {
        color: var(--heading-color-dark);
    }

    .site-nav a {
        color: var(--text-soft-dark);
    }

    .site-nav a:hover,
    .site-nav a.is-active {
        color: var(--heading-color-dark);
        border-bottom-color: color-mix(in srgb, var(--rule-color-dark) 72%, transparent);
    }

    .awards-image-container figcaption {
        color: var(--text-soft-dark);
    }

    #client-testimonials blockquote {
        color: var(--text-color-dark);
        border-left: 1px solid var(--rule-color-dark);
    }

    .book-cover-container a {
        background: color-mix(in srgb, var(--background-color-dark) 88%, white 12%);
        border-color: color-mix(in srgb, var(--rule-color-dark) 34%, transparent);
        box-shadow: 0 18px 34px color-mix(in srgb, var(--shadow-color-dark) 95%, transparent);
    }

    .book-cover-container a::before {
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
    }

    .book-cover-container a:hover {
        box-shadow: 0 22px 40px color-mix(in srgb, var(--shadow-color-dark) 100%, transparent);
    }

    :not(pre) > code {
        background: var(--surface-muted);
        border-color: color-mix(in srgb, var(--surface-border) 70%, transparent);
    }

    .highlight {
        background: var(--surface-muted);
        border-color: color-mix(in srgb, var(--surface-border) 58%, transparent);
    }

    .post-card {
        border-bottom-color: color-mix(in srgb, var(--rule-color-dark) 38%, transparent);
    }

    .post-content blockquote {
        border-left-color: color-mix(in srgb, var(--rule-color-dark) 72%, transparent);
    }

    .post-content th,
    .post-content td {
        border-color: color-mix(in srgb, var(--surface-border) 78%, transparent);
    }

    .awards-image-container img,
    .book-cover {
        box-shadow: 0 14px 30px var(--shadow-color-dark);
    }
}

@media screen and (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
}
