*,
*::before,
*::after {
    box-sizing: border-box;
}
:root {
    color-scheme: dark;

    --bg: #0a0a0a;
    --surface: #141414;
    --surface-2: #1c1c1c;
    --line: rgb(255 255 255 / 0.08);
    --line-strong: rgb(255 255 255 / 0.16);
    --fg: #eeeeee;
    --fg-muted: #b4b4b4;
    --fg-subtle: #7b7b7b;
    --accent: #ff5500;
    --accent-hover: #ff7a33;
    --on-accent: #0a0a0a;

    --fs-sm: 0.8125rem;
    --fs-base: 1rem;
    --fs-lg: 1.25rem;
    --fs-xl: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem);

    --gutter: clamp(16px, 5vw, 48px);
    --page-max: 1200px;
    --read-max: 720px;
    --radius-card: 1.5rem;
    --fx-icon-size: 44px;
}
@media (min-width: 768px) {
    :root {
        --fx-icon-size: 48px;
    }
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}
body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family:
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        "Helvetica Neue",
        Arial,
        "Noto Sans",
        sans-serif,
        "Apple Color Emoji",
        "Segoe UI Emoji";
    font-size: var(--fs-base);
    line-height: 1.75;
    overflow-x: hidden;
}
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote {
    margin: 0;
}
h1,
h2,
h3,
h4,
h5,
h6 {
    font-size: inherit;
    font-weight: inherit;
}
ul,
ol {
    margin: 0;
    padding: 0;
    list-style: none;
}
a {
    color: inherit;
    text-decoration: inherit;
}
img,
svg,
video,
canvas,
iframe {
    display: block;
    max-width: 100%;
}
img,
video {
    height: auto;
}
button {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}
hr {
    height: 0;
    border: 0;
    border-top: 1px solid var(--line);
}
code {
    font-family: "JetBrains Mono", ui-monospace, monospace;
}
.icon {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
}
::selection {
    background: var(--accent);
    color: #fff;
}

.page {
    width: 100%;
    max-width: calc(var(--page-max) + var(--gutter) * 2);
    margin-inline: auto;
    padding-inline: var(--gutter);
    box-sizing: border-box;
}
.page-read {
    max-width: calc(var(--read-max) + var(--gutter) * 2);
}

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

.site-nav {
    position: fixed;
    inset: 0 0 auto;
    z-index: 50;
    pointer-events: none;
    padding-block: 16px;
}
.site-nav .page {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.site-nav a,
.site-nav button,
.site-nav [data-fx-button],
.site-nav .nav-actions {
    pointer-events: auto;
}
.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: var(--fx-icon-size);
    padding: 0 16px 0 6px;
    border-radius: 9999px;
    background: rgb(0 0 0 / 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--line-strong);
    color: var(--fg);
    font-size: var(--fs-sm);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-decoration: none;
    transition: border-color 0.2s;
}
.nav-brand:hover {
    border-color: var(--accent);
}
.nav-brand img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}
.nav-actions {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

[data-fx-button] {
    display: inline-flex;
}
.fx-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: var(--fx-icon-size);
    height: var(--fx-icon-size);
    border-radius: 22%;
    border: 1px solid var(--line-strong);
    background: rgb(0 0 0 / 0.6);
    color: var(--fg);
    cursor: pointer;
    font: inherit;
    text-decoration: none;
}
.fx-fallback.is-text {
    width: auto;
    height: 48px;
    padding: 0 22px;
    border-radius: 9999px;
    font-weight: 600;
}
.fx-fallback svg {
    width: 20px;
    height: 20px;
}

.mini-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 184px;
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    border-radius: 20px;
    background: rgb(20 20 20 / 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--line-strong);
    box-shadow: 0 20px 50px rgb(0 0 0 / 0.5);
    transform-origin: top right;
}
.mini-menu.is-open {
    display: flex;
    animation: menuSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes menuSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
.mini-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--fg-muted);
    font-size: var(--fs-sm);
    font-weight: 700;
    text-decoration: none;
    transition:
        background-color 0.2s,
        color 0.2s;
}
.mini-menu a .icon {
    width: 20px;
    height: 20px;
    margin-inline: 2px;
}
.mini-menu a .menu-hint {
    margin-left: auto;
    color: var(--fg-subtle);
    font-weight: 400;
}
.mini-menu a:hover {
    background: var(--accent);
    color: var(--on-accent);
}
.mini-menu a:hover .menu-hint {
    color: rgb(0 0 0 / 0.55);
}
.mini-menu a[aria-current="page"] {
    background: var(--fg);
    color: var(--bg);
}
.mini-menu a[aria-current="page"] .menu-hint {
    color: rgb(0 0 0 / 0.45);
}
.mini-menu hr {
    margin: 4px 8px;
    border: 0;
    border-top: 1px solid var(--line);
}

.section {
    position: relative;
    z-index: 10;
    padding-block: clamp(56px, 8vw, 96px);
    scroll-margin-top: calc(var(--fx-icon-size) + 8px);
}
.section + .section {
    border-top: 1px solid var(--line);
}
.section-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-bottom: clamp(24px, 4vw, 40px);
}
.section-title {
    margin: 0;
    font-size: var(--fs-xl);
    line-height: 1.15;
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    color: var(--fg);
}
.section-sub {
    font-size: var(--fs-sm);
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--fg-subtle);
}
.section-more {
    margin-left: auto;
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--fg-muted);
    text-decoration: none;
    transition: color 0.2s;
}
.section-more:hover {
    color: var(--accent);
}
.section-icon {
    align-self: center;
    width: 28px;
    height: 28px;
    color: var(--accent);
}
.page-top {
    padding-top: calc(var(--fx-icon-size) + 72px);
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    transition:
        background-color 0.3s,
        border-color 0.3s,
        transform 0.3s;
}
a.card:hover,
.card.is-link:hover {
    background: var(--surface-2);
    border-color: rgb(255 85 0 / 0.35);
}

.tag {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 10px;
    border-radius: 9999px;
    border: 1px solid var(--line-strong);
    color: var(--fg-muted);
    font-size: var(--fs-sm);
    line-height: 1;
}
.meta {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: var(--fs-sm);
    color: var(--accent);
}

.log-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
@media (min-width: 640px) {
    .log-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 1024px) {
    .log-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}
.log-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    padding: clamp(20px, 3vw, 28px);
    box-sizing: border-box;
    color: inherit;
    text-decoration: none;
}
.log-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.log-card-top svg {
    width: 18px;
    height: 18px;
    color: var(--fg-subtle);
    transition:
        color 0.2s,
        transform 0.2s;
}
.log-card:hover .log-card-top svg {
    color: var(--accent);
    transform: translate(2px, -2px);
}
.log-card h3 {
    margin: 0;
    font-size: var(--fs-lg);
    line-height: 1.4;
    font-weight: 700;
    color: var(--fg);
    transition: color 0.2s;
}
.log-card:hover h3 {
    color: var(--accent);
}
.log-card p {
    margin: 0;
    color: var(--fg-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.prose {
    color: var(--fg-muted);
    overflow-wrap: anywhere;
}
.prose > :first-child {
    margin-top: 0;
}
.prose h1,
.prose h2 {
    margin: 2em 0 0.75em;
    font-size: var(--fs-lg);
    line-height: 1.4;
    font-weight: 800;
    color: var(--fg);
}
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
    margin: 1.75em 0 0.5em;
    font-size: var(--fs-base);
    font-weight: 800;
    color: var(--fg);
}
.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose pre,
.prose table,
.prose figure {
    margin: 0 0 1.25em;
}
.prose ul,
.prose ol {
    padding-left: 1.4em;
}
.prose li {
    margin: 0.35em 0;
}
.prose li > p {
    margin: 0;
}
.prose ul {
    list-style: disc;
}
.prose ol {
    list-style: decimal;
}
.prose li::marker {
    color: var(--fg-subtle);
}
.prose strong {
    color: var(--fg);
    font-weight: 700;
}
.prose a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: rgb(255 85 0 / 0.4);
    text-underline-offset: 3px;
}
.prose a:hover {
    text-decoration-color: var(--accent);
}
.prose hr {
    margin: 2.5em 0;
    border: 0;
    border-top: 1px solid var(--line);
}
.prose blockquote {
    padding: 0.25em 0 0.25em 1em;
    border-left: 3px solid var(--accent);
    color: var(--fg-subtle);
}
.prose blockquote > :last-child {
    margin-bottom: 0;
}
.prose img,
.prose video {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1.5em auto;
    border-radius: 12px;
}
.prose code {
    padding: 0.15em 0.4em;
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--fg);
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 0.875em;
}
.prose pre {
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #000;
    overflow-x: auto;
    font-size: var(--fs-sm);
    line-height: 1.6;
}
.prose pre code {
    padding: 0;
    background: none;
    font-size: inherit;
}
.prose table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
}
.prose th,
.prose td {
    padding: 8px 12px;
    border: 1px solid var(--line);
    text-align: left;
}
.prose th {
    color: var(--fg);
    background: var(--surface);
}

.post {
    position: relative;
    z-index: 10;
    padding-top: calc(var(--fx-icon-size) + 72px);
    padding-bottom: clamp(56px, 8vw, 96px);
}
.post-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: clamp(32px, 5vw, 48px);
    padding-bottom: clamp(24px, 4vw, 32px);
    border-bottom: 1px solid var(--line);
}
.post-title {
    font-size: var(--fs-xl);
    line-height: 1.25;
    font-weight: 800;
    color: var(--fg);
}
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.post-pager {
    display: grid;
    gap: 16px;
    margin-top: clamp(48px, 7vw, 72px);
    padding-top: clamp(32px, 5vw, 48px);
    border-top: 1px solid var(--line);
}
@media (min-width: 640px) {
    .post-pager {
        grid-template-columns: 1fr 1fr;
    }
    .post-pager-next {
        text-align: right;
    }
}

.site-footer {
    position: relative;
    z-index: 10;
    border-top: 1px solid var(--line);
    padding-block: 48px 32px;
    color: var(--fg-subtle);
    font-size: var(--fs-sm);
}
.site-footer .page {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}
.footer-thanks {
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0.4;
    filter: grayscale(1);
    letter-spacing: 0.3em;
    transition:
        opacity 0.5s,
        filter 0.5s;
}
.footer-thanks:hover {
    opacity: 1;
    filter: none;
}
.footer-thanks img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}
.footer-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}
@media (min-width: 768px) {
    .footer-row {
        flex-direction: row;
    }
}
.footer-row strong {
    color: var(--fg);
}
.footer-row a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}
.footer-row a:hover {
    color: var(--accent);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
