@font-face {
    font-family: "Satoshi";
    src: url('fonts/Satoshi-Variable.woff2') format('woff2');
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Satoshi";
    src: url('fonts/Satoshi-VariableItalic.woff2') format('woff2');
    font-weight: 400 700;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "BespokeSerif";
    src: url('fonts/BespokeSerif-Variable.woff2') format('woff2');
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "BespokeSerif";
    src: url('fonts/BespokeSerif-VariableItalic.woff2') format('woff2');
    font-weight: 400 700;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "Playfair Display";
    src: url("fonts/playfair-display-v40-latin_latin-ext-regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Playfair Display";
    src: url("fonts/playfair-display-v40-latin_latin-ext-700.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg:      #0c0c0c;
    --fg:      #fff;
    --surface: #1a1a1a;
    --border:  #2a2a2a;
    --muted:   #aaa;
    --subtle:  #888;
    --accent:  #10b981;

    --serif-font:   "BespokeSerif", serif;
    --sans-font:    "Satoshi", sans-serif;
    --display-font: "Playfair Display", serif;
}

[data-theme="light"] {
    --bg:      #f8f8f5;
    --fg:      #121212;
    --surface: #efefec;
    --border:  #ddd;
    --muted:   #555;
    --subtle:  #6b6b6b;
    --accent:  #046c4e;
}

[data-theme="light"] body::after {
    opacity: 0.3;
}

html {
    scroll-behavior: smooth;
}

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

body {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--serif-font);
    min-height: 100vh;
    display: flex;
    align-items: center;
    flex-direction: column;
    max-width: 780px;
    margin: 0 auto;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.1;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

body em {
    font-style: italic;
}

main {
    flex: 1;
    display: flex;
    width: 100%;
}

.wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    animation: fadein 0.6s ease both;
}

.card {
    display: grid;
    grid-template-columns: max-content 1fr;
    grid-template-rows: auto auto;
    width: 100%;
}

@media (max-width: 810px) {
    .card {
        margin: 0 20px;
    }
}

@keyframes fadein {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.photo {
    grid-column: 1;
    grid-row: 1;
    max-width: 400px;
    width: 100%;
    height: 100%;
    border-radius: 5px;
    overflow: hidden;
    padding-bottom: 10px;
}

.photo img {
    width: 250px;
    height: 250px;
    object-fit: cover;
    display: block;
    object-position: center 30%;
    margin: auto;
}

.text {
    grid-column: 2;
    grid-row: 1 / 3;
    margin-left: 20px;
}

.text h1 {
    font-family: var(--sans-font);
    color: var(--fg);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 14px;
    letter-spacing: -0.01em;
}

.text p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--muted);
    font-family: var(--sans-font);
}

.text p strong {
    color: var(--fg);
    font-weight: 700;
}

.text p+p {
    margin-top: 12px;
}

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

.text a:hover {
    text-decoration: underline;
}

.buttons {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    gap: 16px;
    width: 100%;
    align-self: flex-end;
}

.btn {
    display: inline-block;
    padding: 10px 28px;
    border: 1px solid var(--fg);
    color: var(--fg);
    text-decoration: none;
    font-size: 0.9rem;
    transition:
        background 0.2s,
        color 0.2s;
    flex: 1;
    text-align: center;
}

.btn:hover {
    background: var(--fg);
    color: var(--bg);
}

.top-bar {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    padding: 1.25rem 1.5rem 0;
}

.lang-switcher {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 3px;
    background: #166534;
    border-radius: 100px;
    font-family: var(--sans-font);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.lang-opt {
    padding: 4px 11px;
    border-radius: 100px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.2s;
    cursor: pointer;
    user-select: none;
}

.lang-opt:hover {
    color: #fff;
}

.lang-opt--active {
    background: #fff;
    color: #166534;
    cursor: default;
}

.theme-switcher {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 3px;
    background: #166534;
    border-radius: 100px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.theme-opt {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 100px;
    color: rgba(255, 255, 255, 0.8);
    background: none;
    border: none;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
    line-height: 1;
}

.theme-opt:hover {
    color: #fff;
}

.theme-opt--active {
    background: #fff;
    color: #166534;
    cursor: default;
}

.lu {
    margin: auto 0;
    font-family: var(--serif-font);
    padding-bottom: 1em;
    animation: fadein 0.6s ease both;
    align-self: center;
    font-size: 0.75rem;
    color: var(--muted);
}

@media (max-width: 768px) {
    .card {
        grid-template-columns: 1fr;
        padding: 40px 0px;
        row-gap: 28px;
    }

    .photo {
        grid-column: 1;
        grid-row: 1;
        height: 250px;
        margin: auto;
    }

    .text {
        grid-column: 1;
        grid-row: 2;
        margin-left: 0;
    }

    .buttons {
        grid-column: 1;
        grid-row: 3;
        margin-top: 0;
    }
}

/* Blog List */

.blog-list {
    width: 100%;
    padding: 0 24px 48px;
    animation: fadein 0.6s ease both;
}

.blog-list__label {
    display: block;
    font-family: var(--sans-font);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 10px;
}

.blog-list__heading {
    font-family: var(--sans-font);
    font-size: 2rem;
    font-weight: 700;
    color: var(--fg);
    letter-spacing: -0.02em;
    margin-bottom: 24px;
}

.blog-list__divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 0;
}

.blog-list__row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    text-decoration: none;
    color: inherit;
}

.blog-list__row:hover .blog-list__title em {
    color: var(--fg);
}

.blog-list__row:hover .blog-list__read {
    color: var(--accent);
}

.blog-list__title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    font-family: var(--serif-font);
    font-size: 1rem;
    color: var(--muted);
}

.blog-list__badge {
    margin-left: auto;
    font-family: var(--sans-font);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 3px;
    padding: 2px 6px;
    white-space: nowrap;
}

.blog-list__date {
    font-family: var(--sans-font);
    font-size: 0.78rem;
    color: var(--subtle);
    white-space: nowrap;
}

.blog-list__read {
    font-family: var(--sans-font);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--subtle);
    white-space: nowrap;
    transition: color 0.2s;
}

@media (max-width: 768px) {
    .blog-list__row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .blog-list__title {
        flex: 1 0 100%;
    }

    .blog-list__read {
        margin-left: auto;
    }
}

/* Post Page Styles */

.post-wrapper {
    display: block;
    width: 100%;
    padding: 60px 24px 40px;
    animation: fadein 0.6s ease both;
}

.post-back {
    display: inline-block;
    font-size: 0.875rem;
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
    text-underline-offset: 3px;
    margin-bottom: 40px;
    letter-spacing: 0.01em;
}

.post-back:hover {
    text-decoration-color: var(--accent);
}

.post-header {
    margin-bottom: 36px;
}

.post-tag {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

.post-title {
    font-size: 4rem;
    font-family: var(--display-font);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 16px;
}

@media (max-width: 768px) {
    .post-title {
        font-size: 3.5rem;
    }
}

.post-meta {
    font-size: 0.85rem;
    color: var(--subtle);
}

.post-featured-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
    margin-bottom: 36px;
}

.post-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 36px 0;
}

.post-body {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--muted);
}

.post-body h2 {
    font-size: 1.825rem;
    font-weight: 700;
    color: var(--fg);
    margin: 40px 0 16px;
    letter-spacing: -0.01em;
}

.post-body h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--fg);
    margin: 32px 0 12px;
}

.post-body p {
    margin-bottom: 20px;
    text-align: justify;
    font-family: var(--serif-font);
}

.post-body strong {
    color: var(--fg);
    font-weight: 700;
}

.post-body a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
    text-underline-offset: 3px;
}

.post-body a:hover {
    text-decoration-color: var(--accent);
}

.post-body ul,
.post-body ol {
    padding-left: 1.5rem;
    margin-bottom: 20px;
}

.post-body li {
    margin-bottom: 8px;
}

.post-body blockquote {
    border-left: 3px solid var(--accent);
    margin: 28px 0;
    padding: 12px 20px;
    color: var(--subtle);
    font-style: italic;
}

.post-body code {
    background: var(--surface);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
    color: var(--accent);
}

.post-body pre {
    background: var(--surface);
    padding: 20px;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 20px;
}

.post-body pre code {
    background: none;
    padding: 0;
}

.post-body .footnotes {
    font-family: var(--sans-font);
    font-size: 0.8rem;
    font-style: italic;
    color: var(--subtle);
    margin-top: -12px;
    padding-left: 0.5rem;
    border-left: 2px solid var(--border);
}

.sources {
    margin-top: 48px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}

.sources h2 {
    font-family: var(--sans-font);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--subtle);
    margin-bottom: 12px;
}

.sources ol {
    padding-left: 1.25rem;
}

.sources li {
    font-family: var(--sans-font);
    font-size: 0.8rem;
    color: var(--subtle);
    line-height: 1.6;
    margin-bottom: 4px;
}

.sources a {
    color: var(--subtle);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    transition: color 0.2s, border-color 0.2s;
}

.sources a:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.post-footer {
    margin-top: 60px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
}

.post-footer img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 30%;
}

.post-footer-text {
    font-family: var(--sans-font);
    font-size: 0.875rem;
    color: var(--subtle);
}

.post-footer-text strong {
    display: block;
    color: var(--fg);
    margin-bottom: 2px;
}

.post-footer-text a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
    text-underline-offset: 3px;
}

.post-footer-text a:hover {
    text-decoration-color: var(--accent);
}

.post-body__intro {
    margin-bottom: 32px;
    padding: 14px 18px;
    border-left: 3px solid var(--border);
    background: var(--surface);
    border-radius: 0 4px 4px 0;
}

.post-body__intro p {
    font-family: var(--sans-font);
    font-size: 0.82rem;
    line-height: 1.65;
    color: var(--subtle);
    margin-bottom: 0;
    text-align: left;
}

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    backdrop-filter: blur(4px);
    animation: fadein 0.2s ease both;
}

[data-theme="light"] .lightbox {
    background: rgba(248, 248, 245, 0.9);
}


.lightbox--open {
    display: flex;
}

.lightbox__img {
    max-width: min(90vw, 1200px);
    max-height: 90vh;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 8px 48px rgba(0, 0, 0, 0.6);
    cursor: default;
}

.post-img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid var(--border);
    margin: 28px 0;
}

.post-body__intro strong {
    color: var(--subtle);
    font-weight: 600;
}

.table-of-contents {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 20px;
    margin: 32px 0;
}

.table-of-contents h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--fg);
    font-family: var(--sans-font);
    margin: 0px;
}

.table-of-contents ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.table-of-contents li {
    margin-bottom: 8px;
}

.table-of-contents a {
    color: var(--muted);
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--muted) 40%, transparent);
    text-underline-offset: 3px;
    transition: color 0.2s, text-decoration-color 0.2s;
    font-size: 0.9rem;
    font-family: var(--sans-font);
}

.table-of-contents a:hover {
    color: var(--accent);
    text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

.table-of-contents ul ul {
    margin-left: 16px;
    margin-top: 8px;
}

.table-of-contents ul ul li {
    margin-bottom: 4px;
}