:root {
    --accent-color: #0e3386;
    --background-color: #ffffff;
    --surface-color: #ffffff;
    --primary-text-color: #333333;
    --secondary-text-color: #777777;
    --border-color: #e6e6e6;
    --soft-background-color: #f6f6f6;
    --heading-color: #1a1a1a;
    --dark-background-color: #282a35;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --font-mono: Menlo, Consolas, Monaco, "Liberation Mono", "Lucida Console", monospace;
    --page-gap: 3.6rem;
    --page-width: 1200px;
    --content-width: 720px;
    --header-spacing: 60px;
}

@media (max-width: 767px) {
    :root {
        --page-gap: 2rem;
        --header-spacing: 30px;
    }
}

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

html {
    font-size: 62.5%;
    scroll-behavior: smooth;
}

body {
    background: var(--background-color);
    color: var(--primary-text-color);
    font-family: var(--font-sans);
    font-size: 1.6rem;
    line-height: 1.6;
    margin: 0;
    min-height: 100vh;
    text-rendering: optimizeSpeed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button,
input,
textarea {
    font: inherit;
}

button {
    color: inherit;
}

a {
    color: var(--heading-color);
    text-decoration: none;
}

a:hover {
    opacity: 0.82;
}

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

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote {
    margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--heading-color);
    font-family: var(--font-sans);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

h1 {
    font-size: 4.6rem;
}

h2 {
    font-size: 2.8rem;
}

h3 {
    font-size: 2.4rem;
}

h4 {
    font-size: 2.2rem;
}

h5 {
    font-size: 2rem;
}

h6 {
    font-size: 1.8rem;
}

hr {
    background: var(--border-color);
    border: 0;
    height: 1px;
    width: 100%;
}

blockquote {
    border-left: 4px solid var(--accent-color);
    padding-left: 2rem;
}

pre {
    background: var(--soft-background-color);
    line-height: 1.5;
    overflow-x: auto;
    padding: 1.6rem 2.4rem;
    white-space: pre;
}

code {
    font-family: var(--font-mono);
    font-size: 1.5rem;
}

:not(pre) > code {
    background: var(--soft-background-color);
    border-radius: 3px;
    color: var(--accent-color);
    padding: 0.3rem 0.4rem;
}

iframe {
    border: 0;
    display: block;
    width: 100%;
}

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

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex-grow: 1;
    padding: 6rem 0;
}

.page-pad {
    padding-left: var(--page-gap);
    padding-right: var(--page-gap);
}

.page-width {
    margin: 0 auto;
    max-width: var(--page-width);
}

.content-grid {
    --main: min(var(--content-width), calc(100% - var(--page-gap) * 2));
    --wide: minmax(0, calc((var(--page-width) - var(--content-width)) / 2));
    --full: minmax(var(--page-gap), 1fr);
    display: grid;
    grid-template-columns:
        [full-start] var(--full)
        [wide-start] var(--wide)
        [main-start] var(--main)
        [main-end] var(--wide)
        [wide-end] var(--full)
        [full-end];
}

.content-grid > * {
    grid-column: main;
}

.wide {
    grid-column: wide;
}

.button {
    align-items: center;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    color: var(--accent-color);
    display: inline-flex;
    font-size: 1.1rem;
    font-weight: 800;
    height: 36px;
    justify-content: center;
    letter-spacing: 0;
    padding: 0 1.5rem;
    text-transform: uppercase;
}

.button:hover {
    border-color: var(--secondary-text-color);
    opacity: 1;
}

.icon-button {
    align-items: center;
    appearance: none;
    background: transparent;
    border: 0;
    cursor: pointer;
    display: inline-flex;
    height: 30px;
    justify-content: center;
    padding: 0;
    width: 30px;
}

.icon-button:hover {
    opacity: 0.82;
}

.icon {
    height: 20px;
    width: 20px;
}

.site-header {
    background: var(--background-color);
    height: 100px;
}

.site-header-inner {
    align-items: center;
    column-gap: 2.8rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    height: 100%;
}

.site-brand {
    line-height: 1;
}

.site-brand-wrapper {
    align-items: center;
    display: flex;
}

.site-logo {
    display: block;
    position: relative;
}

.site-logo img {
    max-height: 90px;
}

.site-logo img:nth-child(2) {
    left: 0;
    opacity: 0;
    position: absolute;
    top: 0;
}

.site-nav {
    display: flex;
    margin-left: 16px;
}

.nav-list {
    align-items: center;
    display: inline-flex;
    gap: 2.8rem;
    list-style: none;
    margin: 0;
    padding: 0;
    white-space: nowrap;
}

.site-header .nav-list {
    font-size: 1.5rem;
    font-weight: 700;
}

.site-actions {
    align-items: center;
    display: flex;
    gap: 2.8rem;
    justify-content: flex-end;
}

.subscribe-area {
    align-items: center;
    display: flex;
    white-space: nowrap;
}

.menu-toggle {
    appearance: none;
    background: transparent;
    border: 0;
    cursor: pointer;
    display: none;
    height: 30px;
    margin-right: -3px;
    padding: 0;
    position: relative;
    width: 30px;
}

.menu-toggle::before,
.menu-toggle::after {
    background: var(--heading-color);
    content: "";
    height: 1px;
    left: 3px;
    position: absolute;
    transition: transform 0.2s, top 0.2s, bottom 0.2s;
    width: 24px;
}

.menu-toggle::before {
    top: 11px;
}

.menu-toggle::after {
    bottom: 11px;
}

.is-menu-open .menu-toggle::before {
    top: 15px;
    transform: rotate(45deg);
}

.is-menu-open .menu-toggle::after {
    bottom: 14px;
    transform: rotate(-45deg);
}

.cover {
    margin-bottom: 6.4rem;
    margin-top: 48px;
}

.cover-content {
    align-items: center;
    display: flex;
    flex-direction: column;
    max-width: 520px;
    text-align: center;
}

.cover-icon {
    margin-bottom: 32px;
}

.cover-icon-image {
    width: 120px;
}

.cover-description {
    font-size: 1.7rem;
}

.post-row {
    align-items: center;
    display: flex;
    line-height: 1;
    overflow: hidden;
    padding: 1.5rem 0;
    position: relative;
}

.post-row + .post-row {
    border-top: 1px solid var(--border-color);
}

.post-row:hover .post-row-title {
    opacity: 0.82;
}

.post-row:hover .post-row-meta {
    margin-right: 1.6rem;
}

.post-row:hover .post-row-icon {
    transform: translateX(0.4rem);
}

.post-date {
    color: var(--accent-color);
    display: flex;
    font-size: 1.2rem;
    font-weight: 800;
    gap: 0.4rem;
    margin-right: 1.6rem;
    min-width: 45px;
    white-space: nowrap;
}

.post-date-month {
    text-transform: uppercase;
}

.post-row-title {
    flex-grow: 1;
    font-size: 1.6rem;
    font-weight: 400;
    line-height: 1.3;
    overflow: hidden;
    padding-right: 1rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-row-meta {
    align-items: center;
    display: flex;
    transition: margin 0.2s ease-in-out;
}

.reading-time {
    color: var(--secondary-text-color);
    font-size: 1.4rem;
    white-space: nowrap;
}

.post-row-icon {
    color: var(--secondary-text-color);
    height: 16px;
    position: absolute;
    right: 0;
    transform: translateX(2rem);
    transition: transform 0.2s ease-in-out;
    width: 16px;
}

.stretched-link {
    bottom: 0;
    left: 0;
    outline: none;
    position: absolute;
    right: 0;
    top: 0;
    z-index: 1;
}

.load-more {
    display: flex;
    justify-content: center;
    margin-top: 48px;
}

.article-header {
    margin-bottom: 4.5rem;
    margin-top: var(--header-spacing);
    text-align: center;
}

.article-meta {
    color: var(--secondary-text-color);
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.article-title {
    font-size: 4rem;
    line-height: 1.2;
    word-break: break-word;
}

.article-excerpt {
    font-size: 1.8rem;
    margin-top: 2rem;
    word-break: break-word;
}

.article-media {
    margin-top: 4.5rem;
}

.article-media img {
    width: 100%;
}

.article-content {
    font-size: 1.7rem;
    margin-top: 4rem;
    word-break: break-word;
}

.article-content > * + * {
    margin-bottom: 0;
    margin-top: 1.6em;
}

.article-content > h2:not(:first-child),
.article-content > h3:not(:first-child),
.article-content > h4:not(:first-child) {
    margin-top: 1.6em;
}

.article-content > h2 + *,
.article-content > h3 + *,
.article-content > h4 + * {
    margin-top: 0.8em;
}

.article-content h2 {
    font-size: 1.6em;
}

.article-content h3 {
    font-size: 1.4em;
}

.article-content a {
    color: var(--accent-color);
    text-decoration: underline;
    word-break: break-word;
}

.article-content dl,
.article-content ol,
.article-content ul {
    padding-left: 2.8rem;
}

.article-content li + li,
.article-content li :is(ul, ol) {
    margin-top: 0.8rem;
}

.article-content ol ol li {
    list-style-type: lower-alpha;
}

.article-content ol ol ol li {
    list-style-type: lower-roman;
}

.article-content table {
    border-collapse: collapse;
    border-spacing: 0;
    display: inline-block;
    font-size: 1.6rem;
    max-width: 100%;
    overflow-x: auto;
    vertical-align: top;
    white-space: nowrap;
    width: auto;
    -webkit-overflow-scrolling: touch;
}

.article-content th {
    background: var(--background-color);
    color: var(--heading-color);
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0;
    text-align: left;
    text-transform: uppercase;
}

.article-content td,
.article-content th {
    border: 1px solid var(--border-color);
    padding: 6px 12px;
}

.article-content figcaption {
    color: var(--secondary-text-color);
    font-size: 1.4rem;
    line-height: 1.4;
    margin-top: 1.6rem;
    text-align: center;
}

.article-content .footnotes {
    font-size: 0.9em;
}

.article-footer {
    align-items: center;
    display: grid;
    margin-top: 4.5rem;
}

.article-footer-left,
.article-footer-right {
    display: flex;
    grid-row: 1;
}

.article-footer-left {
    grid-column: wide-start / main-start;
}

.article-footer-middle {
    grid-column: main;
    grid-row: 1;
}

.article-footer-right {
    grid-column: main-end / wide-end;
}

.article-footer-right {
    justify-content: flex-end;
}

.article-footer-middle,
.article-footer-top {
    display: flex;
    flex-direction: column;
}

.article-footer-top {
    align-items: center;
}

.article-footer-title {
    font-size: 1.8rem;
}

.post-nav-link {
    align-items: center;
    display: flex;
    height: 30px;
    width: 30px;
}

.post-nav-icon {
    height: 20px;
    width: 20px;
}

.site-footer {
    padding-bottom: 4rem;
}

.site-footer-inner {
    align-items: center;
    color: var(--heading-color);
    display: flex;
    font-size: 1.4rem;
    justify-content: space-between;
}

.footer-nav .nav-list {
    gap: 1.6rem;
}

.search-overlay {
    align-items: flex-start;
    background: rgba(255, 255, 255, 0.94);
    display: none;
    inset: 0;
    justify-content: center;
    padding: 12vh var(--page-gap) 4rem;
    position: fixed;
    z-index: 5000000;
}

.search-overlay.is-open {
    display: flex;
}

.search-dialog {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.14);
    max-width: 720px;
    overflow: hidden;
    width: 100%;
}

.search-form {
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    display: flex;
}

.search-input {
    appearance: none;
    background: var(--surface-color);
    border: 0;
    border-radius: 0;
    color: var(--heading-color);
    font-size: 2rem;
    height: 64px;
    outline: none;
    padding: 0 1.5rem;
    width: 100%;
}

.search-close {
    appearance: none;
    background: transparent;
    border: 0;
    color: var(--secondary-text-color);
    cursor: pointer;
    font-size: 3rem;
    height: 64px;
    line-height: 1;
    width: 64px;
}

.search-results {
    max-height: min(58vh, 620px);
    overflow-y: auto;
}

.search-result {
    display: grid;
    gap: 0.5rem;
    padding: 1.8rem 2rem;
}

.search-result + .search-result {
    border-top: 1px solid var(--border-color);
}

.search-result-title {
    color: var(--heading-color);
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.25;
}

.search-result-date {
    color: var(--accent-color);
    font-size: 1.2rem;
    font-weight: 800;
    text-transform: uppercase;
}

.search-result-excerpt,
.search-empty {
    color: var(--secondary-text-color);
    font-size: 1.5rem;
    line-height: 1.45;
}

.search-empty {
    padding: 2rem;
}

@media (max-width: 767px) {
    h1 {
        font-size: 3.2rem;
    }

    h2 {
        font-size: 2.4rem;
    }

    h3 {
        font-size: 2.1rem;
    }

    .main-content {
        padding: 3rem 0;
    }

    .site-header {
        height: 64px;
    }

    .site-header-inner {
        gap: 48px;
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }

    .site-brand {
        align-items: center;
        display: grid;
        grid-template-columns: 1fr auto;
        height: 64px;
    }

    .site-logo img {
        max-height: 64px;
    }

    .menu-toggle {
        display: block;
    }

    .site-nav,
    .site-actions {
        justify-content: center;
        opacity: 0;
        position: fixed;
        visibility: hidden;
    }

    .site-actions .search-button {
        display: none;
    }

    .site-header .nav-list {
        align-items: center;
        flex-direction: column;
        gap: 20px;
        line-height: 1.4;
    }

    .site-header .nav-list a {
        font-size: 2.6rem;
        font-weight: 700;
    }

    .site-header .nav-item {
        opacity: 0;
        transform: translateY(-4px);
    }

    .site-actions {
        text-align: center;
    }

    .subscribe-button {
        font-size: 1.8rem;
        width: 100%;
    }

    .is-menu-open .site-header {
        background: var(--background-color);
        height: 100%;
        inset: 0;
        overflow-y: auto;
        position: fixed;
        z-index: 3999999;
        -webkit-overflow-scrolling: touch;
    }

    .is-menu-open .site-nav,
    .is-menu-open .site-actions {
        opacity: 1;
        position: static;
        visibility: visible;
    }

    .is-menu-open .site-header .nav-item {
        opacity: 1;
        transform: translateY(0);
        transition: transform 0.2s, opacity 0.2s;
    }

    .is-menu-open .site-actions {
        align-items: center;
        background: var(--background-color);
        bottom: 0;
        display: inline-flex;
        flex-direction: column;
        gap: 12px;
        left: 0;
        padding: var(--page-gap) 0 calc(var(--page-gap) + 8px);
        position: sticky;
        right: 0;
    }

    .cover {
        margin-bottom: 4.8rem;
        margin-top: 30px;
    }

    .article-header {
        margin-bottom: 3rem;
    }

    .article-title {
        font-size: 2.6rem;
    }

    .article-excerpt,
    .article-content {
        font-size: 1.7rem;
    }

    .article-media {
        margin-top: 3rem;
    }

    .site-footer-inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 1.2rem;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #282a35;
        --surface-color: #282a35;
        --primary-text-color: #ffffff;
        --secondary-text-color: #c5c7d0;
        --border-color: #3b3e46;
        --soft-background-color: #2f333c;
        --heading-color: #ffffff;
    }

    .site-logo img:first-child:not(:only-child) {
        opacity: 0;
    }

    .site-logo img:nth-child(2) {
        opacity: 1;
    }

    .button,
    .site-header a,
    .article-content a {
        color: #ffffff;
    }

    .post-date {
        color: #ffffe5;
    }

    .search-overlay {
        background: rgba(40, 42, 53, 0.94);
    }
}
