/* HardMatrix · "negro con oro"
 * Dark gruvbox base, near-black filled boxes, cream rules,
 * and a single dark-gold accent. Flat neobrutalist chrome:
 * 2px borders, hard offset shadows, no rounded corners.
 */

* {
    box-sizing: border-box;
}

:root {
    --bg: #282828;
    --bg-raised: #3c3836;
    --panel: #1d2021;
    --panel-deep: #191b1c;
    --ink: #111010;
    --cream: #ebdbb2;
    --fg: #ebdbb2;
    --fg-dim: #d5c4a1;
    --fg-mute: #bdae93;
    --gray: #7c6f64;
    --gold: #b57614;
    --gold-bright: #d79921;
    --line: #504945;
    --gruvbox-ochre: #d79921;
    --gruvbox-orange: #d65d0e;
    --gruvbox-blue: #458588;
    --gruvbox-blue-bright: #83a598;
}

body {
    background-color: var(--bg);
    color: var(--fg);
    font-family: 'Fira Mono', monospace;
    font-size: 1rem;
    line-height: 1.65;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Keep the background structural and decorative so panels remain opaque and
 * readable while the grid spans every page without an image asset. */
body::before {
    content: "";
    position: fixed;
    z-index: 0;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(to right, rgba(60, 56, 54, 0.34) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(60, 56, 54, 0.34) 1px, transparent 1px),
        linear-gradient(to right, rgba(80, 73, 69, 0.23) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(80, 73, 69, 0.23) 1px, transparent 1px);
    background-position: 0 0, 0 0, 0 0, 0 0;
    background-repeat: repeat, repeat, repeat, repeat;
    background-size: 24px 24px, 24px 24px, 120px 120px, 120px 120px;
}

::selection {
    background: var(--gold);
    color: var(--ink);
}

.container {
    display: flex;
    position: relative;
    z-index: 1;
    min-height: 100vh;
    flex-direction: column;
}

main {
    width: min(100%, 1140px);
    flex: 1;
    margin: 0 auto;
    padding: 2rem clamp(1.25rem, 4vw, 3rem) 4.5rem;
}

.skip-link {
    position: fixed;
    z-index: 20;
    top: 0.65rem;
    left: 0.65rem;
    padding: 0.45rem 0.7rem;
    transform: translateY(-200%);
    border: 2px solid var(--cream);
    background: var(--gold);
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 700;
}

.skip-link:focus {
    transform: translateY(0);
}

a:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

/* Header */

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 3.25rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.55rem 0.95rem 0.55rem 0.7rem;
    border: 2px solid var(--cream);
    background: var(--panel);
    box-shadow: 5px 5px 0 var(--ink);
    color: var(--cream);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: none;
    transition: translate 120ms ease, box-shadow 120ms ease;
}

.brand span {
    text-shadow: 3px 3px 0 var(--ink);
}

.brand:hover,
.brand:focus-visible {
    border-color: var(--cream);
    color: var(--cream);
    outline-color: var(--cream);
    text-decoration: none;
    translate: -2px -2px;
    box-shadow: 7px 7px 0 var(--ink);
}

.brand-mark {
    display: block;
    width: 2.5rem;
    height: auto;
    margin: 0;
}

.site-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
}

.site-links a,
.article-header .back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.25rem;
    padding: 0.5rem 0.85rem;
    border: 2px solid var(--cream);
    background: var(--panel);
    color: var(--cream);
    font-size: 0.69rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    line-height: 1;
    box-shadow: 3px 3px 0 var(--ink);
    transition: translate 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}

.site-links a:hover,
.site-links a:focus-visible,
.article-header .back-link:hover,
.article-header .back-link:focus-visible {
    translate: -2px -2px;
    border-color: var(--cream);
    background: var(--panel);
    color: var(--cream);
    text-decoration: none;
    box-shadow: 5px 5px 0 var(--ink);
}

.site-links a:focus-visible,
.article-header .back-link:focus-visible {
    outline-color: var(--cream);
}

.social-link {
    gap: 0.38rem;
}

.social-link-icon-only {
    min-width: 0;
}

.social-icon {
    display: block;
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
    fill: currentColor;
}

.social-icon-outline {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Home page */

.home-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    margin: 0 auto;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    overflow: hidden;
    border: 2px solid var(--cream);
    background: var(--panel);
    box-shadow: 8px 8px 0 var(--ink);
    isolation: isolate;
}

.home-hero::before,
.home-hero::after {
    content: "";
    position: absolute;
    z-index: 4;
    width: 1.15rem;
    height: 1.15rem;
    pointer-events: none;
    filter: drop-shadow(3px 3px 0 var(--ink));
}

.home-hero::before {
    top: 0.7rem;
    left: 0.7rem;
    border-top: 4px solid var(--gold);
    border-left: 4px solid var(--gold);
}

.home-hero::after {
    right: 0.7rem;
    bottom: 0.7rem;
    border-right: 4px solid var(--gold);
    border-bottom: 4px solid var(--gold);
}

.intro {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1.35fr) minmax(19rem, 0.65fr);
    grid-template-rows: auto minmax(0, 1fr);
    align-items: stretch;
    gap: clamp(2rem, 5vw, 4rem);
    margin: 0 auto;
    text-align: left;
}

.tagline {
    position: relative;
    z-index: 2;
    grid-column: 1;
    grid-row: 1;
    max-width: 15ch;
    margin: 0;
    color: var(--cream);
    font-size: clamp(2rem, 5vw, 3.35rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.02em;
}

.home-hero .tagline {
    color: var(--gruvbox-ochre);
    text-shadow: 3px 3px 0 var(--ink);
}

.about {
    position: relative;
    z-index: 2;
    grid-column: 1;
    grid-row: 2;
    margin: 0;
    color: var(--fg-dim);
    font-size: clamp(1rem, 1.6vw, 1.12rem);
    line-height: 1.75;
    text-align: left;
}

.home-hero-visual {
    position: static;
    width: 100%;
    grid-column: 2;
    grid-row: 1 / span 2;
    min-width: 0;
    min-height: 27rem;
    align-self: stretch;
    margin: 0;
}

.life-canvas {
    position: absolute;
    z-index: 0;
    inset: 0;
    display: block;
    width: 100%;
    max-width: none;
    height: 100%;
    margin: 0;
}

.life-readout {
    position: absolute;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    color: var(--fg-mute);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.15;
    pointer-events: none;
    text-transform: uppercase;
    top: 0.75rem;
    right: 0.75rem;
    left: auto;
    gap: 0.35rem;
    text-align: right;
}

.life-title {
    color: var(--gold);
    white-space: nowrap;
    text-transform: none;
}

.life-readout-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.5rem;
    white-space: nowrap;
}

.life-generation {
    color: var(--cream);
    font-variant-numeric: tabular-nums;
}

.life-logo.is-replay-ready {
    cursor: pointer;
}

.life-fallback {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 50%;
    width: min(68%, 18rem);
    height: auto;
    margin: 0;
    transform: translate(-50%, -50%);
}

@media (max-width: 820px) {
    .intro {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto;
        gap: 1.75rem;
        text-align: center;
    }

    .tagline {
        grid-column: 1;
        grid-row: 2;
        margin: 0 auto;
    }

    .about {
        grid-column: 1;
        grid-row: 3;
    }

    .home-hero-visual {
        grid-column: 1;
        grid-row: 1;
        min-height: 0;
        aspect-ratio: 4 / 3;
    }
}

@media (max-width: 440px) {
    .life-readout {
        left: 2.75rem;
        justify-content: flex-end;
    }
}

.home-details {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(14rem, 1fr);
    gap: 2rem;
    margin: 2.5rem auto 0;
}

.collaborators,
.contact {
    margin: 0;
    padding: 1.4rem 1.4rem 1.6rem;
    border: 2px solid var(--cream);
    background: var(--panel);
    box-shadow: 8px 8px 0 var(--ink);
}

.contact {
    border-color: var(--gruvbox-ochre);
}

.collaborators h2,
.contact h2 {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin: 0 0 1.5rem;
    color: var(--cream);
    font-size: 0.936rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    line-height: 1.4;
    text-shadow: 3px 3px 0 var(--ink);
    text-transform: none;
}

.collaborator-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: center;
}

.collaborator-link {
    display: inline-flex;
    width: fit-content;
    min-width: 0;
    align-items: center;
    gap: 0.65rem;
    color: var(--fg-mute);
    font-size: 0.72rem;
    line-height: 1.3;
    opacity: 0.72;
    white-space: nowrap;
}

.collaborator-link:hover {
    opacity: 1;
    text-decoration: none;
}

.collaborator-link img {
    width: auto;
    max-width: 100%;
    height: 1.75rem;
    margin: 0;
}

.collaborator-logo-invert img {
    filter: invert(1);
}

.contact address {
    color: var(--fg-dim);
    font-size: 1rem;
    font-style: normal;
}

.contact address a {
    color: var(--gold);
    font-weight: 700;
}

.contact address a:hover {
    color: var(--gold-bright);
    text-decoration: underline;
}

@keyframes contact-card-highlight {
    0%,
    100% {
        background: var(--panel);
        border-color: var(--cream);
        box-shadow: 8px 8px 0 var(--ink);
    }

    22%,
    52% {
        background: var(--bg-raised);
        border-color: var(--gold-bright);
        box-shadow: 8px 8px 0 var(--gold);
    }
}

.contact.contact-highlight {
    animation: contact-card-highlight 2.10s ease-out;
}

@media (prefers-reduced-motion: reduce) {
    .contact.contact-highlight {
        animation: none;
    }
}

/* Blog index */

.blog-index {
    margin: 0 auto;
}

.blog-hero {
    margin-bottom: 2.9rem;
}

.blog-hero h1 {
    margin: 0;
    color: var(--cream);
    font-family: inherit;
    font-size: clamp(2rem, 4vw, 2.7rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.1;
    text-transform: uppercase;
}

.blog-hero p {
    margin: 1rem 0 0;
    color: var(--fg-mute);
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.featured-posts {
    margin-top: 0;
}

.latest-posts {
    margin-top: 3.6rem;
}

.featured-posts h2,
.latest-posts h2 {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 0 0 1.4rem;
    color: var(--cream);
    font-size: 1.235rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    line-height: 1.4;
    text-transform: uppercase;
}

.section-label {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    height: 2.25rem;
    padding: 0.5rem 0.85rem;
    border: 2px solid var(--gold);
    background: var(--panel);
    color: var(--gruvbox-ochre);
    font-size: 0.69rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    line-height: 1;
    text-transform: none;
    text-shadow: 3px 3px 0 var(--ink);
    box-shadow: 3px 3px 0 var(--ink);
}

.featured-posts h2::after,
.latest-posts h2::after {
    content: "";
    flex: 1;
    height: 2px;
    background: var(--gold);
    box-shadow: 3px 3px 0 var(--ink);
}

.featured-posts .section-label {
    border-color: var(--gold);
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.9rem;
}

.featured-card {
    position: relative;
    display: flex;
    flex-direction: column;
    margin-top: 0.95rem;
    border: 2px solid var(--cream);
    background: var(--panel);
    box-shadow: 8px 8px 0 var(--ink);
    transition: translate 120ms ease, box-shadow 120ms ease;
}

.featured-card:hover,
.featured-card:focus-within {
    translate: -2px -2px;
    box-shadow: 10px 10px 0 var(--ink);
}

.card-badge {
    position: absolute;
    z-index: 1;
    top: -0.95rem;
    left: 1rem;
    padding: 0.22rem 0.68rem;
    border: 2px solid var(--cream);
    background: var(--panel-deep);
    color: var(--cream);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.featured-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 17rem;
    margin: 1.25rem 1.5rem 0.5rem;
    padding: 0;
    border: 2px solid var(--gray);
    box-shadow: 4px 4px 0 var(--ink);
    background: var(--panel);
}

.featured-image img,
.post-thumb img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0;
    background: var(--panel);
    object-fit: contain;
}

.card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    padding: 1.35rem 1.5rem 1.5rem;
}

.post-taxonomy {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    line-height: 1.4;
}

.tag-link {
    display: inline-flex;
    align-items: center;
    min-height: 1.5rem;
    padding: 0.1rem 0.55rem;
    border: 1.5px solid var(--fg-dim);
    color: var(--gold);
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.06em;
}

.tag-link:hover,
.tag-link.is-current {
    background: var(--gold);
    color: var(--ink);
    text-decoration: none;
}

.featured-card .tag-link,
.post-meta .tag-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--gray);
    font-weight: 500;
}

.featured-card .tag-link:hover,
.featured-card .tag-link:focus-visible,
.featured-card .tag-link.is-current,
.post-meta .tag-link:hover,
.post-meta .tag-link:focus-visible,
.post-meta .tag-link.is-current {
    background: none;
    color: var(--gold-bright);
    text-decoration: none;
}

.featured-card h3 {
    margin: 0.9rem 0 0.65rem;
    color: var(--cream);
    font-size: clamp(1.1rem, 2vw, 1.32rem);
    line-height: 1.42;
}

.featured-card h3 a,
.post-row h2 a,
.post-row h3 a {
    color: inherit;
}

.featured-card h3 a:hover,
.post-row h2 a:hover,
.post-row h3 a:hover {
    color: var(--gold-bright);
    text-decoration: none;
}

/* Stretch the existing title link across each card without nesting links. */
.featured-card h3 a::after,
.post-row h2 a::after,
.post-row h3 a::after {
    content: "";
    position: absolute;
    z-index: 2;
    inset: 0;
    cursor: pointer;
}

.featured-card h3 a::after {
    top: -0.95rem;
}

.featured-card .tag-link,
.featured-card .featured-image,
.featured-card .read-more,
.post-row .tag-link,
.post-row .post-thumb,
.post-row .read-more {
    position: relative;
    z-index: 3;
}

.featured-card p {
    margin: 0 0 1.5rem;
    color: var(--fg-dim);
    font-size: 0.83rem;
    line-height: 1.7;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: auto;
    padding: 0.55rem 0.85rem;
    border: 2px solid var(--cream);
    background: var(--bg);
    color: var(--gold);
    font-size: 0.69rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    line-height: 1;
    text-transform: uppercase;
    text-shadow: 2px 2px 0 var(--ink);
    box-shadow: 4px 4px 0 var(--ink);
    transition: translate 120ms ease, box-shadow 120ms ease, color 120ms ease;
}

.featured-card .read-more {
    align-self: flex-end;
    margin-top: auto;
}

.read-more:hover,
.read-more:focus-visible {
    translate: -2px -2px;
    box-shadow: 6px 6px 0 var(--ink);
    color: var(--gold);
    text-decoration: none;
}

.latest-read-more {
    align-self: flex-end;
    margin-top: auto;
}

.post-list {
    display: grid;
    grid-auto-rows: 15rem;
    gap: 1rem;
}

.post-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.4rem;
    align-items: stretch;
    height: 100%;
    padding: 1.25rem 1.5rem;
    border: 2px solid var(--cream);
    background: var(--panel);
    box-shadow: 5px 5px 0 var(--ink);
    transition: translate 120ms ease, box-shadow 120ms ease;
}

.post-row.has-image {
    grid-template-columns: minmax(18rem, 0.55fr) minmax(0, 1fr);
}

.post-row:hover,
.post-row:focus-within {
    translate: -2px -2px;
    box-shadow: 7px 7px 0 var(--ink);
}

.post-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.65rem;
    color: var(--gray);
    font-size: 0.66rem;
    letter-spacing: 0.08em;
}

.post-meta .sep {
    color: var(--line);
}

.post-date {
    color: var(--gray);
    white-space: nowrap;
}

.post-row h2,
.post-row h3 {
    margin: 0.5rem 0 0.45rem;
    color: var(--cream);
    font-size: clamp(0.98rem, 1.8vw, 1.08rem);
    line-height: 1.5;
}

.post-row p {
    margin: 0;
    color: var(--fg-mute);
    font-size: 0.83rem;
    line-height: 1.65;
}

.post-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 11rem;
    height: 11rem;
    max-height: 11rem;
    align-self: center;
    padding: 0;
    border: 2px solid var(--gray);
    box-shadow: 4px 4px 0 var(--ink);
    background: var(--panel);
}

.post-row:hover .post-thumb,
.post-row:focus-within .post-thumb {
    border-color: var(--gray);
}

/* Article page */

.article {
    max-width: 760px;
    margin: 0 auto;
}

.back-link {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.8rem;
    border: 2px solid var(--cream);
    background: var(--panel);
    color: var(--cream);
    font-size: 0.69rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    line-height: 1;
    text-transform: uppercase;
    transition: background-color 120ms ease;
}

.back-link:hover {
    background: var(--ink);
    color: var(--cream);
    text-decoration: none;
}

.article-header {
    margin-bottom: clamp(2rem, 5vw, 3rem);
    padding: 0;
}

.article-header .back-link {
    margin-bottom: 1.25rem;
    border-color: var(--gold);
    background: var(--panel);
    color: var(--gruvbox-ochre);
}

.article-header .back-link:hover,
.article-header .back-link:focus-visible {
    border-color: var(--gold);
    background: var(--panel);
    color: var(--gruvbox-ochre);
}

.article-header .back-link:focus-visible {
    outline-color: var(--gold);
}

.article-header h1 {
    max-width: 720px;
    margin: 0 0 clamp(1.5rem, 4vw, 2.25rem);
    color: var(--cream);
    font-size: clamp(1.6rem, 4vw, 2.65rem);
    line-height: 1.18;
}

.article-header time {
    display: block;
}

.article-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 1rem;
}

.article-meta time {
    color: var(--gray);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-align: right;
    white-space: nowrap;
}

.archive-header {
    margin-bottom: clamp(2rem, 5vw, 3rem);
    padding: 1.5rem 1.65rem;
    border: 2px solid var(--cream);
    background: var(--panel);
    box-shadow: 8px 8px 0 var(--ink);
}

.archive-header .back-link {
    margin-bottom: 1.25rem;
}

.archive-header h1 {
    margin: 0 0 0.45rem;
    color: var(--cream);
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    line-height: 1.2;
    text-transform: uppercase;
}

.archive-header p {
    margin: 0;
    color: var(--fg-mute);
    font-size: 0.85rem;
}

.tag-prefix {
    color: var(--gold);
}

.tag-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.tag-directory-link {
    display: flex;
    min-height: 4rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1.1rem;
    border: 2px solid var(--cream);
    background: var(--panel);
    box-shadow: 5px 5px 0 var(--ink);
    color: var(--fg-dim);
    transition: translate 120ms ease, box-shadow 120ms ease;
}

.tag-directory-link:hover {
    translate: -2px -2px;
    box-shadow: 7px 7px 0 var(--ink);
    background: var(--ink);
    color: var(--cream);
    text-decoration: none;
}

.tag-name {
    color: var(--cream);
}

.tag-name::before {
    content: "#";
    margin-right: 0.2rem;
    color: var(--gold);
}

.tag-count {
    color: var(--gray);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    white-space: nowrap;
    text-transform: uppercase;
}

/* Article content */

.article-content {
    color: var(--fg-dim);
    font-size: clamp(1rem, 1.6vw, 1.12rem);
    line-height: 1.78;
}

.article-content h2 {
    margin: 2.75rem 0 1rem;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: var(--cream);
    font-size: clamp(1.2rem, 2vw, 1.45rem);
    line-height: 1.35;
}

.article-content h3 {
    margin: 2rem 0 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gold);
    color: var(--cream);
    font-size: clamp(1.05rem, 1.7vw, 1.2rem);
    line-height: 1.4;
}

.article-content a {
    color: var(--gold);
}

.article-content a:hover {
    color: var(--gold-bright);
    text-decoration: underline;
}

.article-content :not(pre) > code {
    padding: 0.08em 0.3em;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: var(--bg-raised);
    color: var(--cream);
    font-size: 0.94em;
}

.article-content .math {
    color: var(--cream);
}

.article-content div.math {
    width: 100%;
    margin: 1.4rem 0;
    padding: 1rem 1.2rem;
    overflow-x: auto;
    background: var(--panel);
    text-align: center;
}

.article-content div.math .MathJax_Display {
    width: max-content;
    min-width: 100%;
    margin-right: auto !important;
    margin-left: auto !important;
    text-align: center !important;
}

.article-content p:has(> img:only-child),
.article-content .image-frame {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    margin: 2rem 0;
    padding: 0;
    overflow: hidden;
    border: 2px solid var(--gray);
    box-shadow: 4px 4px 0 var(--ink);
    background: var(--panel);
}

.article-content p:has(> img:only-child) > img,
.article-content .image-frame > img {
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
    border: 0;
    background: var(--panel);
    object-fit: contain;
}

.article-content img[src$="/images/blog/4-pytorch.drawio.svg"] {
    padding-left: 1%;
}

.article-content .image-frame.image-wide > img {
    width: 100%;
}

.article-content blockquote {
    margin: 1.4rem 0;
    padding: 0.8rem 1.1rem;
    border-left: 4px solid var(--gold);
    color: var(--fg-mute);
    background: var(--panel);
}

.article-content li::marker {
    color: var(--gold);
}

.article-content table {
    display: block;
    width: 100%;
    margin: 1.6rem 0 2rem;
    overflow-x: auto;
    border: 2px solid var(--cream);
    border-collapse: separate;
    border-spacing: 0;
    background: var(--panel);
    box-shadow: 4px 4px 0 var(--ink);
    font-size: 0.78rem;
}

.article-content th,
.article-content td {
    padding: 0.65rem 0.75rem;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.article-content th {
    color: var(--cream);
    background: var(--ink);
}

.article-content th:last-child,
.article-content td:last-child {
    border-right: 0;
}

.article-content tbody tr:last-child td {
    border-bottom: 0;
}

.article-content hr {
    height: 2px;
    margin: 3.25rem 0;
    border: 0;
    background: var(--line);
}

/* Base elements */

h1,
h2,
h3 {
    color: var(--cream);
    margin-top: 1rem;
    font-size: 2.2rem;
}

p {
    margin: 0 0 1.4rem;
}

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

a:hover {
    color: var(--gold-bright);
    text-decoration: underline;
}

img {
    width: 100%;
    max-width: 400px;
    height: auto;
    display: block;
    margin: 0 auto 2rem auto;
}

.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: 2rem;
    padding: 1.4rem max(1.25rem, calc((100vw - 1140px) / 2)) 1.6rem;
    border-top: 2px solid var(--cream);
    color: var(--fg-mute);
    font-size: 0.69rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.site-footer b {
    color: var(--gold);
    font-weight: 700;
}

.site-footer .site-email {
    color: var(--gold);
    text-transform: none;
}

.site-footer .site-email:hover,
.site-footer .site-email:focus-visible {
    color: var(--gold-bright);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 0.2em;
}

/* Responsive */

@media (max-width: 900px) {
    .post-row.has-image {
        grid-template-columns: minmax(14rem, 0.5fr) minmax(0, 1fr);
    }

    .post-list {
        grid-auto-rows: 15rem;
    }
}

@media (max-width: 640px) {
    main {
        padding-right: 1rem;
        padding-left: 1rem;
        padding-top: 1.25rem;
    }

    .site-header {
        display: block;
        margin-bottom: 2.25rem;
    }

    .brand {
        display: none;
    }

    .site-links {
        width: 100%;
        min-width: 0;
        max-width: none;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 0.28rem;
    }

    .site-links a,
    .article-header .back-link {
        flex: 1 1 auto;
        min-width: max-content;
        height: 2rem;
        padding: 0.42rem 0.34rem;
        font-size: 0.62rem;
        letter-spacing: 0.02em;
        white-space: nowrap;
    }

    .social-link {
        gap: 0.22rem;
    }

    .social-icon {
        width: 0.9rem;
        height: 0.9rem;
    }

    .home-hero {
        padding: 1.3rem 1.2rem;
    }

    .tagline {
        font-size: clamp(2rem, 10vw, 2.75rem);
    }

    .home-details {
        display: block;
    }

    .collaborator-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
        justify-items: center;
    }

    .collaborator-link {
        width: 100%;
        justify-content: center;
    }

    .contact {
        margin-top: 1.75rem;
    }

    .featured-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 2.4rem;
    }

    .post-row,
    .post-row.has-image {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.75rem;
        align-items: start;
        height: auto;
    }

    .post-list {
        grid-auto-rows: auto;
    }

    .post-thumb {
        width: 100%;
        min-height: 10rem;
        height: 10rem;
        max-height: 10rem;
    }

    .latest-read-more {
        margin-top: 1rem;
    }

    .article-meta {
        display: block;
    }

    .article-meta time {
        margin-top: 0.65rem;
        text-align: left;
    }

    .tag-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .archive-header {
        padding: 1.3rem 1.2rem;
    }

    .site-footer {
        display: block;
        padding: 1rem 1.25rem 1.2rem;
    }

    .site-footer span {
        display: block;
    }

    .site-footer span + span {
        margin-top: 0.4rem;
    }
}

@media (max-width: 360px) {
    main {
        padding-right: 0.5rem;
        padding-left: 0.5rem;
    }

    .site-links {
        gap: 0.18rem;
    }

    .site-links a,
    .article-header .back-link {
        height: 2rem;
        padding-right: 0.24rem;
        padding-left: 0.24rem;
        font-size: 0.58rem;
    }

    .social-link {
        gap: 0.18rem;
    }

    .social-icon {
        width: 0.88rem;
        height: 0.88rem;
    }
}
