* { box-sizing: border-box }

:root {
    --bg-color: #fff;
    --text-color: #000;
    --text-muted: #555;
    --code-bg: #eee;
    --border-color: #ddd;
    --link-color: blue;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --text-color: #e0e0e0;
        --text-muted: #aaa;
        --code-bg: #2a2a2a;
        --border-color: #444;
        --link-color: #6db3f2;
        color-scheme: dark;
    }
}

:root[data-theme="light"] {
    --bg-color: #fff;
    --text-color: #000;
    --text-muted: #555;
    --code-bg: #eee;
    --border-color: #ddd;
    --link-color: blue;
    color-scheme: light;
}

:root[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --text-muted: #aaa;
    --code-bg: #2a2a2a;
    --border-color: #444;
    --link-color: #6db3f2;
    color-scheme: dark;
}

html {
    background-color: var(--bg-color);
    color: var(--text-color);
    tab-size: 4;
    font: 16px / 180% sans-serif;
}

/* Mobile font sizes */
@media (max-width: 52em) {
    html {
        font-size: 14px;
    }
    
    h1 {
        font-size: 1.8em;
        line-height: 1.2;
        margin-top: 0;
        margin-bottom: 0.4em;
    }
    
    h2 {
        font-size: 1.5em;
        line-height: 1.25;
        margin-top: 1.2em;
        margin-bottom: 0.4em;
    }
    
    h3 {
        font-size: 1.3em;
        line-height: 1.3;
        margin-top: 1em;
        margin-bottom: 0.3em;
    }
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    line-height: 1.3;
}

h1 {
    margin-top: 0;
}

nav {
    margin: 0.75em auto 0.5em;
    max-width: 54em;
    padding: 0 1em;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1em;
    border-bottom: 1px solid var(--border-color);
}

.nav-links {
    display: flex;
    justify-content: flex-start;
    gap: 0.9em;
    flex-wrap: wrap;
    padding: 0.35em 0;
}

.nav-link {
    font-size: 0.92em;
    color: var(--text-muted);
}

.nav-link.active {
    color: var(--text-color);
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

ul, li {
    margin: 0 0;
    margin-left: 0.5em;
    padding: 0;
}

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

time {
    font-size: 0.7em;
}

.master-container {
    display: flex;
    justify-content: center;
    margin: 0.5rem 0;
}

article {
    display: block;
    max-width: 54em;
    width: 100%;
    min-width: 0;
}

.site-header {
    display: flex;
    align-items: center;
    gap: 1em;
    max-width: 54em;
    margin: 1em auto;
    padding: 0 1em;
}

.header-author-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    flex-shrink: 0;
}

.header-info {
    display: flex;
    flex-direction: column;
    gap: 0.25em;
    flex: 1;
    min-width: 0;
}

.header-name {
    color: inherit;
    text-decoration: none;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    padding: 0.18em 0.55em;
    border: 1px solid var(--border-color);
    border-radius: 0.35em;
    background: var(--bg-color);
    color: var(--text-muted);
    cursor: pointer;
    font: inherit;
    font-size: 0.78em;
    line-height: 1.35;
}

.theme-toggle:hover {
    background: var(--code-bg);
    color: var(--text-color);
}

.theme-toggle-icon {
    width: 1em;
    text-align: center;
}

.header-description {
    font-size: 0.9em;
    color: var(--text-muted);
}

.header-links {
    display: flex;
    justify-content: space-between;
    gap: 1.5em;
    width: 100%;
    font-size: 0.85em;
}

.header-links-contact {
    display: flex;
    align-items: center;
    gap: 0.45em;
}

.header-email {
    white-space: nowrap;
}

.header-cv {
    white-space: nowrap;
}

.header-links-separator {
    color: var(--text-muted);
}

.header-links .icon {
    width: 1.7em;
    height: 1.7em;
}

.source-link {
    display: flex;
    align-items: center;
    gap: 0.2em;
}

.site-footer {
    border-top: 1px solid var(--border-color);
    margin: 2.5em auto 1.5em;
    padding: 1.2em 1em 0;
    max-width: 54em;
}

.footer-content {
    display: flex;
    justify-content: center;
    font-size: 0.85em;
}

.page{
    max-width: 54rem;
    margin-bottom: 1em;
    padding: 1em 1em;
    overflow-wrap: anywhere;
}

.home-essays {
    margin-top: 1.25em;
}

.home-essays-heading {
    margin-top: 0;
    text-align: center;
}

.home-essay-tab-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.home-essay-tab-controls {
    display: flex;
    width: min(100%, 24rem);
    margin: 0.8em auto 0;
    border: 1px solid var(--border-color);
    border-radius: 0.5em;
    overflow: hidden;
}

.home-essay-tab-controls label + label {
    border-left: 1px solid var(--border-color);
}

.home-essay-tab {
    flex: 1 1 0;
    max-width: none;
    padding: 0.45em 1em;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1.4;
    text-align: center;
}

#home-essay-tab-recent:checked ~ .home-essay-tab-controls label[for="home-essay-tab-recent"],
#home-essay-tab-recommended:checked ~ .home-essay-tab-controls label[for="home-essay-tab-recommended"] {
    color: var(--text-color);
    background-color: var(--code-bg);
}

.home-essay-tab-panels {
    margin-top: 0.9em;
}

.home-essay-panel {
    display: none;
}

#home-essay-tab-recent:checked ~ .home-essay-tab-panels .home-essay-panel-recent,
#home-essay-tab-recommended:checked ~ .home-essay-tab-panels .home-essay-panel-recommended {
    display: block;
}

.home-essays-all-link {
    margin: 0.35em 0 0;
    text-align: center;
}

.post-footer {
    margin-top: 3em;
    padding: 1em;
    border: 1px solid var(--border-color);
    border-radius: 0.35em;
    color: var(--text-muted);
    font-size: 0.95em;
}

.post-footer p {
    margin: 0.6em 0 0;
}

.post-footer p:first-child {
    margin-top: 0;
}

.post-footer-share {
    margin-top: 0.8em;
}

.post-footer-share-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6em;
    margin-top: 0.65em;
}

.post-share-link {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    justify-self: start;
    gap: 0.45em;
    padding: 0;
    color: var(--text-color);
}

.post-share-link .icon {
    width: 1.05em;
    height: 1.05em;
}

.post-share-link:hover {
    text-decoration: underline;
}

.icon {
    width: 2em;
    height: 2em;
}

.hover:hover {
    opacity: 0.7;
    transform: scale(1.1);
}

img {
    max-width: 100%;
}

img[src$='#center']
{
    display: block;
    margin: 0.7rem auto; /* you can replace the vertical '0.7rem' by
                            whatever floats your boat, but keep the
                            horizontal 'auto' for this to work */
    /* whatever else styles you fancy here */
}


img[src$='#fullsize']
{
    display: block;
    width: 100%;
    height: auto;
    margin: 0.7rem auto; /* you can replace the vertical '0.7rem' by
                            whatever floats your boat, but keep the
                            horizontal 'auto' for this to work */
    /* whatever else styles you fancy here */
}

img[src$='#halfsize']
{
    display: block;
    width: 50%;
    height: auto;
    margin: 0.7rem auto; /* you can replace the vertical '0.7rem' by
                            whatever floats your boat, but keep the
                            horizontal 'auto' for this to work */
    /* whatever else styles you fancy here */
}

img[src$='#75persize']
{
    display: block;
    width: 75%;
    height: auto;
    margin: 0.7rem auto; /* you can replace the vertical '0.7rem' by
                            whatever floats your boat, but keep the
                            horizontal 'auto' for this to work */
    /* whatever else styles you fancy here */
}

blockquote {
  position: relative;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  padding-left: 2rem;
  padding-right: 1rem;
  font-style: italic;
  margin: auto;
}

blockquote::before, blockquote::after {
  position: absolute;
  font-size: 3rem;
}

blockquote::before {
  content: "“";
  top: 0.5rem;
  left: 0.5rem;
}

blockquote::after {
  content: "”";
  bottom: 0.5rem;
  right: 0.5rem;
}

/* --- Override for alert-style blockquotes --- */
blockquote.alert {
  position: static;
  font-style: normal;
  border: 1px solid #e5e7eb;
  border-left-width: 6px;
  border-radius: 0.5rem;
  padding: 0.875rem 1rem;
  margin: 1rem 0;
  background: #f9fafb;
}

/* Remove decorative quotation marks for alerts */
blockquote.alert::before,
blockquote.alert::after {
  content: none;
}

/* Headings inside alert */
blockquote.alert .alert-heading {
  font-weight: 600;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Base alert text spacing */
blockquote.alert p {
  margin: 0.25rem 0;
}

/* --- Variants --- */
blockquote.alert.alert-note {
  border-left-color: #3b82f6;
  background: #eff6ff;
}

blockquote.alert.alert-tip {
  border-left-color: #10b981;
  background: #ecfdf5;
}

blockquote.alert.alert-warning {
  border-left-color: #f59e0b;
  background: #fffbeb;
}

blockquote.alert.alert-important {
  border-left-color: #7c3aed;
  background: #f5f3ff;
}

blockquote.alert.alert-caution {
  border-left-color: #ef4444;
  background: #fef2f2;
}

/* Dark mode alert overrides */
@media (prefers-color-scheme: dark) {
  blockquote.alert {
    border-color: #444;
    background: #2a2a2a;
  }

  blockquote.alert.alert-note {
    border-left-color: #3b82f6;
    background: #1e3a5f;
  }

  blockquote.alert.alert-tip {
    border-left-color: #10b981;
    background: #1a3d2e;
  }

  blockquote.alert.alert-warning {
    border-left-color: #f59e0b;
    background: #3d3520;
  }

  blockquote.alert.alert-important {
    border-left-color: #7c3aed;
    background: #2d2548;
  }

  blockquote.alert.alert-caution {
    border-left-color: #ef4444;
    background: #3d2020;
  }
}

:root[data-theme="dark"] blockquote.alert {
  border-color: #444;
  background: #2a2a2a;
}

:root[data-theme="dark"] blockquote.alert.alert-note {
  border-left-color: #3b82f6;
  background: #1e3a5f;
}

:root[data-theme="dark"] blockquote.alert.alert-tip {
  border-left-color: #10b981;
  background: #1a3d2e;
}

:root[data-theme="dark"] blockquote.alert.alert-warning {
  border-left-color: #f59e0b;
  background: #3d3520;
}

:root[data-theme="dark"] blockquote.alert.alert-important {
  border-left-color: #7c3aed;
  background: #2d2548;
}

:root[data-theme="dark"] blockquote.alert.alert-caution {
  border-left-color: #ef4444;
  background: #3d2020;
}

:root[data-theme="light"] blockquote.alert {
  border-color: #e5e7eb;
  background: #f9fafb;
}

:root[data-theme="light"] blockquote.alert.alert-note {
  border-left-color: #3b82f6;
  background: #eff6ff;
}

:root[data-theme="light"] blockquote.alert.alert-tip {
  border-left-color: #10b981;
  background: #ecfdf5;
}

:root[data-theme="light"] blockquote.alert.alert-warning {
  border-left-color: #f59e0b;
  background: #fffbeb;
}

:root[data-theme="light"] blockquote.alert.alert-important {
  border-left-color: #7c3aed;
  background: #f5f3ff;
}

:root[data-theme="light"] blockquote.alert.alert-caution {
  border-left-color: #ef4444;
  background: #fef2f2;
}

@media (max-width: 52em) {
    .nav-inner {
        align-items: flex-start;
    }

    .site-header {
        flex-direction: column;
        text-align: center;
    }

    .header-links {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 0.5em;
    }

    .header-links .icon {
        width: 2em;
        height: 2em;
    }

    blockquote {
        padding-left: 1.2rem;
        padding-right: 0.3rem;
        padding-top: 0.3rem;
        padding-bottom: 0.3rem;
    }

    blockquote::before, blockquote::after {
        font-size: 2rem;
    }

    blockquote::before {
        top: 0.2rem;
        left: 0.2rem;
    }

    blockquote::after {
        bottom: 0.2rem;
        right: 0.2rem;
    }
}

@media (min-width: 52em){
    .page {
        min-width: 35em;
    }
}

pre {
  padding-left: 1.5em;
  margin-left: 0;
  overflow-x: auto;
  overflow-y: hidden;
  background-color: var(--code-bg);
}

pre > code {
    background-color: var(--code-bg);
}

code {
    background-color: var(--code-bg);
    border-radius: 0.3em;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    padding: 0.18em 0.6em;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background-color: transparent;
    color: var(--text-muted);
    font-size: 0.88em;
    line-height: 1.4;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.tag:hover {
    background-color: var(--code-bg);
    border-color: var(--text-muted);
    color: var(--text-color);
    text-decoration: none;
}

.tag span {
    color: var(--text-muted);
    font-size: 0.78em;
}

.taxonomy-title {
    display: flex;
    align-items: center;
    gap: 0.5em;
    flex-wrap: wrap;
}

.taxonomy-tag {
    font-size: 0.72em;
    vertical-align: middle;
}

.blog-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45em;
    margin-bottom: 1.5em;
}

.page-tags {
    margin-top: 0.5em;
    margin-bottom: 0.85em;
}

.blog-tags-label {
    color: var(--text-muted);
}

.series-meta {
    display: flex;
    align-items: center;
    gap: 0.5em;
    flex-wrap: wrap;
    color: var(--text-muted);
}

.page-series {
    margin-bottom: 0.35em;
}

.blog-entry-series {
    margin-bottom: 0.1em;
}

.series-kicker {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75em;
    font-weight: 600;
}

.series-kicker-link {
    color: inherit;
}

.series-kicker-link:hover {
    text-decoration: underline;
}

.series-entry {
    font-size: 0.75em;
}

.blog-entry {
    display: flex;
    align-items: flex-start;
    gap: 0.6em;
    margin-bottom: 1.5em;
    padding: 0.95em 1em;
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.blog-entry-content {
    display: flex;
    flex-direction: column;
    gap: 0.25em;
    max-width: 36em;
    flex: 1;
}

.blog-entry-title {
    font-size: 1.1em;
}

.blog-entry-description {
    margin: 0;
    font-size: 0.9em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-muted);
}

.blog-entry-content time {
    font-size: 0.8em;
    color: var(--text-muted);
}

.blog-entry-thumbnail {
    width: 220px;
    max-width: 40vw;
    height: auto;
    aspect-ratio: 220 / 145;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

@media (max-width: 60em) {
    img[src$='#halfsize'],
    img[src$='#75persize'] {
        width: 100%;
    }

    .blog-entry {
        padding: 0.8em;
    }

    .blog-entry-thumbnail {
        width: 120px;
        max-width: 30vw;
        aspect-ratio: 220 / 145;
    }
}

.highlights {
    font-weight: bold;
}
