/* FolderMD.com — a typographic letter. */

@font-face {
    font-family: "Plex Serif";
    src: url("/fonts/IBMPlexSerif-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Plex Serif";
    src: url("/fonts/IBMPlexSerif-SemiBold.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Plex Mono";
    src: url("/fonts/JetBrainsMono-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --paper: #f7f6f0;
    --ink: #1a1614;
    --muted: #5d564f;
    --hair: #d8d4c8;
    --oxblood: #8b1e1e;
    --paper-deep: #efece1;

    --measure: 36rem;
    --measure-wide: 52rem;

    --serif: "Plex Serif", "Iowan Old Style", "Palatino", Georgia, serif;
    --mono: "Plex Mono", "SF Mono", "JetBrains Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --paper: #16140f;
        --ink: #e8e4d9;
        --muted: #968d80;
        --hair: #2f2a23;
        --oxblood: #c97070;
        --paper-deep: #1d1a14;
    }
}

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

html {
    font-size: 18px;
}
@media (min-width: 900px) {
    html {
        font-size: 19px;
    }
}

body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--serif);
    font-weight: 400;
    font-feature-settings:
        "kern",
        "liga",
        "onum" 1,
        "lnum" 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    line-height: 1.6;
    letter-spacing: 0.005em;

    /* faint paper grain via repeating linear-gradient — readable, not noisy */
    background-image:
        radial-gradient(
            at 20% 10%,
            color-mix(in srgb, var(--paper-deep) 30%, transparent) 0px,
            transparent 60%
        ),
        radial-gradient(
            at 80% 90%,
            color-mix(in srgb, var(--paper-deep) 25%, transparent) 0px,
            transparent 60%
        );
    background-attachment: fixed;

    min-height: 100vh;
    padding: 0;
}

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

/* ──────────────────────────────────────────────── layout */

.page {
    max-width: var(--measure-wide);
    margin: 0 auto;
    padding: 4rem 1.5rem 6rem;
}
@media (min-width: 700px) {
    .page {
        padding: 6rem 2.5rem 8rem;
    }
}

.colophon {
    max-width: var(--measure-wide);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-top: 2rem;
    padding-bottom: 2rem;
    border-top: 1px solid var(--hair);
    margin-top: 6rem;
    color: var(--muted);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
@media (min-width: 700px) {
    .colophon {
        padding: 2rem 2.5rem;
    }
}

/* Variant: two-row footer (skills nav above, meta below) */
.colophon:has(.footer-skills) {
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
}
.footer-skills {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.4rem 1rem;
}
.footer-skills-label {
    color: var(--muted);
    opacity: 0.75;
    margin-right: 0.25rem;
}
.footer-skills a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease;
}
.footer-skills a:hover {
    border-bottom-color: currentColor;
}
.footer-skills-sep {
    color: var(--oxblood);
    font-style: italic;
    opacity: 0.6;
    margin: 0 0.25rem;
}
.footer-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
}

/* ──────────────────────────────────────────────── masthead */

.masthead {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 0.5rem auto;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    /*border-bottom: 1px solid var(--hair);*/
}

.brand {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink);
    text-decoration: none;
}
.brand em {
    /*font-style: italic;*/
    color: var(--oxblood);
    letter-spacing: 0;
    text-transform: none;
    font-weight: 400;
}

.nav {
    display: flex;
    gap: 1.5rem;
}
.nav a {
    color: var(--muted);
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    transition: color 200ms ease;
}
.nav a:hover {
    color: var(--oxblood);
}
.nav a.is-active {
    color: var(--ink);
}

/* ──────────────────────────────────────────────── lede */

.lede {
    max-width: var(--measure);
    margin: 0 auto 4rem;
}
.lede h1 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2.6rem, 6vw + 1rem, 4.4rem);
    line-height: 1.05;
    letter-spacing: -0.018em;
    margin-bottom: 1.5rem;
}
.lede h1 em {
    font-style: italic;
    color: var(--oxblood);
}

.lede p {
    font-size: 1.18rem;
    line-height: 1.55;
    color: var(--ink);
    max-width: var(--measure);
}

.lede .drop::first-letter {
    font-family: var(--serif);
    font-weight: 600;
    initial-letter: 3;
    -webkit-initial-letter: 3;
    color: var(--oxblood);
    margin-right: 0.18em;
    font-feature-settings: "lnum" 1;
}

/* ──────────────────────────────────────────────── body prose */

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

.prose > * + * {
    margin-top: 1.25rem;
}

.prose h2 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 1.5rem;
    letter-spacing: -0.01em;
    margin-top: 4rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--hair);
    display: flex;
    align-items: baseline;
    gap: 1rem;
}
.prose h2 .num {
    font-feature-settings:
        "onum" 1,
        "lnum" 0;
    color: var(--oxblood);
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    font-style: italic;
}

.prose h3 {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 1.05rem;
    margin-top: 2rem;
    letter-spacing: -0.005em;
}

.prose p,
.prose li {
    font-size: 1.05rem;
    line-height: 1.7;
}

.prose em {
    font-style: italic;
}
.prose strong {
    font-weight: 600;
}

.prose a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--oxblood);
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    transition:
        color 200ms ease,
        text-decoration-color 200ms ease;
}
.prose a:hover {
    color: var(--oxblood);
}

.prose ul,
.prose ol {
    padding-left: 1.4rem;
}
.prose li + li {
    margin-top: 0.6rem;
}
.prose ol {
    list-style: none;
    counter-reset: step;
    padding-left: 0;
}
.prose ol > li {
    counter-increment: step;
    position: relative;
    padding-left: 3rem;
}
.prose ol > li::before {
    content: counter(step, decimal-leading-zero) " ·";
    position: absolute;
    left: 0;
    top: 0.1em;
    font-feature-settings:
        "onum" 1,
        "lnum" 0;
    color: var(--oxblood);
    font-style: italic;
    font-size: 0.9rem;
}

.prose blockquote {
    border-left: 2px solid var(--oxblood);
    padding-left: 1.25rem;
    font-style: italic;
    color: var(--muted);
    margin: 2rem 0;
}

.prose code {
    font-family: var(--mono);
    font-size: 0.92em;
    background: var(--paper-deep);
    padding: 0.1em 0.35em;
    border-radius: 2px;
    color: var(--ink);
}

.prose pre {
    font-family: var(--mono);
    font-size: 0.88rem;
    line-height: 1.55;
    background: var(--paper-deep);
    border: 1px solid var(--hair);
    padding: 1.1rem 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}
.prose pre code {
    background: transparent;
    padding: 0;
    font-size: inherit;
}

.prose hr {
    border: none;
    text-align: center;
    margin: 3rem 0;
    color: var(--hair);
    letter-spacing: 0.6em;
}
.prose hr::before {
    content: "❦";
    color: var(--oxblood);
    font-size: 1.2rem;
}

/* small-caps inline helper */
.sc {
    font-variant-caps: all-small-caps;
    letter-spacing: 0.08em;
    font-weight: 600;
}

/* ──────────────────────────────────────────────── marginalia (large screens) */

.with-marginalia {
    position: relative;
}
.marginalia {
    display: none;
    position: absolute;
    width: 12rem;
    right: -14rem;
    top: 0.35em;
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--muted);
    font-style: italic;
    border-left: 1px solid var(--hair);
    padding-left: 0.9rem;
}
@media (min-width: 1180px) {
    .marginalia {
        display: block;
    }
}

/* ──────────────────────────────────────────────── app preview */

.preview-frame {
    margin: 3rem auto 0;
    max-width: 720px;
    border: 1px solid var(--hair);
    background: var(--paper);
    box-shadow:
        0 1px 0 var(--paper-deep),
        0 30px 60px -30px color-mix(in srgb, var(--ink) 22%, transparent),
        0 12px 24px -12px color-mix(in srgb, var(--ink) 10%, transparent);
    overflow: hidden;
    user-select: none;
}

.preview-chrome {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.75rem;
    background: var(--paper-deep);
    border-bottom: 1px solid var(--hair);
}
.preview-chrome .dot {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background: var(--hair);
}
.preview-chrome .title {
    margin-left: 0.6rem;
    font-size: 0.78rem;
    color: var(--muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.preview-body {
    display: grid;
    grid-template-columns: 11rem 1fr;
    min-height: 360px;
}

.preview-sidebar {
    border-right: 1px solid var(--hair);
    padding: 1rem 0.85rem;
    background: var(--paper-deep);
    font-size: 0.78rem;
}
.preview-sidebar .group {
    color: var(--muted);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.68rem;
    margin: 0.4rem 0 0.45rem;
}
.preview-sidebar .item {
    padding: 0.4rem 0.5rem;
    margin: 0 -0.35rem;
    border-radius: 2px;
    line-height: 1.3;
}
.preview-sidebar .item.is-active {
    background: var(--paper);
}
.preview-sidebar .item .title {
    display: block;
    color: var(--ink);
    font-weight: 600;
    font-size: 0.84rem;
}
.preview-sidebar .item .meta {
    color: var(--muted);
    font-size: 0.7rem;
    font-style: italic;
}

.preview-reader {
    padding: 1.5rem 1.6rem 1.2rem;
    font-size: 0.86rem;
    line-height: 1.6;
    overflow: hidden;
}
.preview-reader h4 {
    font-weight: 400;
    font-size: 1.4rem;
    margin: 0 0 0.7rem;
    letter-spacing: -0.01em;
}
.preview-reader p {
    margin-bottom: 0.7rem;
}
.preview-reader .code {
    display: block;
    font-family: var(--mono);
    font-size: 0.78rem;
    background: var(--paper-deep);
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--hair);
    white-space: pre;
    overflow-x: auto;
    margin-top: 0.4rem;
}
.preview-reader .code .c {
    color: var(--muted);
}
.preview-reader .code .s {
    color: var(--oxblood);
    font-style: italic;
}

/* ──────────────────────────────────────────────── buy */

.buy {
    margin-top: 5rem;
    padding: 3rem 0 0;
    border-top: 1px solid var(--hair);
    text-align: center;
}
.buy .price {
    font-family: var(--serif);
    font-size: 4rem;
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.02em;
    font-feature-settings:
        "onum" 1,
        "lnum" 0;
}
.buy .price .currency {
    font-size: 1.6rem;
    vertical-align: super;
    color: var(--oxblood);
    font-style: italic;
}
.buy .terms {
    margin-top: 0.5rem;
    color: var(--muted);
    font-style: italic;
}

.btn {
    display: inline-block;
    margin-top: 2rem;
    padding: 0.85rem 2.4rem;
    background: var(--paper);
    color: var(--ink);
    border: 1.5px solid var(--ink);
    font-family: var(--serif);
    font-weight: 600;
    font-size: 0.92rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition:
        background 220ms ease,
        color 220ms ease,
        transform 180ms ease,
        box-shadow 220ms ease;
}
.btn:hover {
    background: var(--ink);
    color: var(--paper);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--ink) 50%, transparent);
}
.btn:active {
    transform: translateY(0);
}

/* ──────────────────────────────────────────────── signoff letter */

.signoff {
    margin-top: 5rem;
    max-width: var(--measure);
    margin-left: auto;
    margin-right: auto;
    font-style: italic;
    color: var(--muted);
    border-left: 2px solid var(--oxblood);
    padding-left: 1.5rem;
}
.signoff .signature {
    font-style: italic;
    margin-top: 1.5rem;
    color: var(--ink);
}

/* ──────────────────────────────────────────────── motion */

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lede h1,
.lede p,
.prose > * {
    animation: fadeUp 500ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.lede h1 {
    animation-delay: 0ms;
}
.lede p {
    animation-delay: 120ms;
}
.prose > :nth-child(1) {
    animation-delay: 200ms;
}
.prose > :nth-child(2) {
    animation-delay: 260ms;
}
.prose > :nth-child(3) {
    animation-delay: 320ms;
}
.prose > :nth-child(4) {
    animation-delay: 380ms;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* ──────────────────────────────────────────────── side-by-side compare */

.compare {
    position: relative;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    margin-top: 0;
    margin-bottom: 5rem;
    padding: 2.5rem 1.5rem 4rem;
    background: var(--paper-deep);
    border-top: 1px solid var(--hair);
    border-bottom: 1px solid var(--hair);
}
@media (min-width: 700px) {
    .compare {
        padding: 3rem 2.5rem 5rem;
    }
}

.compare-intro {
    max-width: 48rem;
    margin: 0 auto 2.5rem;
    text-align: center;
}
.compare-intro h1 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2.4rem, 5.5vw + 1rem, 4.2rem);
    line-height: 1.05;
    letter-spacing: -0.018em;
    margin: 0 0 1.4rem;
}
.compare-intro h1 em {
    font-style: italic;
    color: var(--oxblood);
}
.compare-sub {
    font-family: var(--serif);
    font-style: italic;
    font-size: 1.08rem;
    line-height: 1.55;
    color: var(--muted);
    margin: 0 auto;
    max-width: 38rem;
}
.compare-sub em {
    font-style: italic;
    color: var(--oxblood);
}

/* bridging paragraph that sits between hero (.compare) and the chapters */
.lede.after-hero {
    margin-top: 5rem;
    margin-bottom: 4rem;
}

.compare-wrap {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    align-items: stretch;
}
@media (min-width: 900px) {
    .compare-wrap {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}

.compare-col {
    display: flex;
    flex-direction: column;
}
.compare-col > .terminal-frame,
.compare-col > .preview-frame {
    display: flex;
    flex-direction: column;
}

.compare-caption {
    margin-top: 1.2rem;
    text-align: center;
    font-family: var(--serif);
    font-style: italic;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.55;
    max-width: 32rem;
    margin-left: auto;
    margin-right: auto;
}
.compare-caption strong {
    display: block;
    font-style: normal;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.74rem;
    margin-bottom: 0.4rem;
}

/* terminal frame — dark in both light and dark mode (it's always a terminal) */

.terminal-frame {
    background: #1a1614;
    border: 1px solid #2f2a23;
    box-shadow:
        0 1px 0 #000,
        0 30px 60px -30px rgba(0, 0, 0, 0.45),
        0 12px 24px -12px rgba(0, 0, 0, 0.22);
    overflow: hidden;
    font-family: var(--mono);
    color: #d8d4c8;
    user-select: none;
}
.terminal-chrome {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.8rem;
    background: #2a241f;
    border-bottom: 1px solid #3a322a;
}
.terminal-chrome .dot {
    width: 0.72rem;
    height: 0.72rem;
    border-radius: 50%;
}
.terminal-chrome .dot--r {
    background: #ff5f56;
}
.terminal-chrome .dot--y {
    background: #ffbd2e;
}
.terminal-chrome .dot--g {
    background: #27c93f;
}
.terminal-chrome .title {
    margin-left: 0.65rem;
    font-size: 0.74rem;
    color: #968d80;
    letter-spacing: 0.03em;
    font-family: var(--mono);
}

.terminal-body {
    margin: 0;
    padding: 1rem 1.1rem 0;
    font-family: var(--mono);
    font-size: 0.74rem;
    line-height: 1.55;
    flex: 1 1 auto;
    height: 460px;
    overflow: hidden;
    white-space: pre;
    position: relative;
    color: #d8d4c8;
    mask-image: linear-gradient(to bottom, #000 0, #000 78%, transparent 100%);
    -webkit-mask-image: linear-gradient(
        to bottom,
        #000 0,
        #000 78%,
        transparent 100%
    );
}
.terminal-body .prompt {
    color: #6f9cdc;
}
.terminal-body .ai {
    color: #d4a05a;
}
.terminal-body .path {
    color: #8bb38b;
    text-decoration: underline;
    text-decoration-color: #3a4f3a;
    text-underline-offset: 2px;
}
.terminal-body .hash {
    color: #c97070;
}
.terminal-body .fence {
    color: #5d564f;
}
.terminal-body .bullet {
    color: #c97070;
}
.terminal-body .str {
    color: #d4a05a;
}
.terminal-body .tool {
    color: #6c8d6c;
}
.terminal-body .muted {
    color: #5d564f;
    font-style: italic;
}
.terminal-body .cursor {
    display: inline-block;
    width: 0.55em;
    height: 1em;
    background: #d8d4c8;
    vertical-align: text-bottom;
    margin-left: 0.1em;
    animation: blink 1s steps(2) infinite;
}
@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* compare-specific tweaks to the preview-frame */

.compare .preview-frame {
    margin: 0;
    max-width: 100%;
}
.compare .preview-body {
    min-height: 0;
    height: 460px;
    flex: 1 1 auto;
    overflow: hidden;
}
.compare .preview-reader {
    overflow: hidden;
    padding: 1.3rem 1.5rem 1.2rem;
}
.compare .preview-reader .rh {
    margin-top: 0.9rem;
    font-weight: 600;
    font-style: normal;
    letter-spacing: 0.02em;
    font-size: 0.9rem;
}
.compare .preview-reader .rl {
    list-style: none;
    margin: 0.4rem 0 0.6rem;
    padding: 0;
}
.compare .preview-reader .rl li {
    font-size: 0.85rem;
    line-height: 1.55;
    padding-left: 0.9rem;
    position: relative;
}
.compare .preview-reader .rl li::before {
    content: "·";
    position: absolute;
    left: 0;
    color: var(--oxblood);
}
.compare .preview-reader code {
    font-family: var(--mono);
    font-size: 0.85em;
    background: var(--paper-deep);
    padding: 0.06em 0.3em;
    border-radius: 2px;
}
.compare .preview-reader .code {
    font-size: 0.74rem;
    padding: 0.65rem 0.8rem;
    margin-top: 0.5rem;
    white-space: pre;
    overflow: hidden;
}

/* ──────────────────────────────────────────────── compare animation */

/* status banner shown above the two panes during animation */
.compare-status {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 0.65rem;
    margin: 0 auto 1.6rem;
    font-family: var(--serif);
    font-style: italic;
    font-size: 0.98rem;
    color: var(--muted);
    letter-spacing: 0.005em;
    margin-top: 4rem;
}
.compare.is-animating .compare-status {
    display: flex;
}
.compare-status .status-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--oxblood);
    flex: 0 0 auto;
    animation: watchPulse 1.6s ease-in-out infinite;
}
.compare-status .status-text {
    display: none;
    align-items: baseline;
}
.compare.is-animating:not(.is-revealed) .compare-status .status-working {
    display: inline-flex;
}
.compare.is-animating.is-revealed .compare-status .status-saved {
    display: inline;
}
.compare.is-animating.is-revealed .status-dot {
    background: #6c8d6c;
    animation: none;
}

@keyframes watchPulse {
    0%,
    100% {
        opacity: 0.35;
        transform: scale(0.85);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

.dots {
    display: inline-block;
    margin-left: 0.05em;
    letter-spacing: 0.15em;
}
.dots span {
    display: inline-block;
    opacity: 0.25;
    animation: dotBlink 1.4s infinite;
}
.dots span:nth-child(2) {
    animation-delay: 0.2s;
}
.dots span:nth-child(3) {
    animation-delay: 0.4s;
}
@keyframes dotBlink {
    0%,
    100% {
        opacity: 0.25;
    }
    50% {
        opacity: 1;
    }
}

/* terminal "scrolling" mask flips to top-fade while animating */
.compare.is-animating .terminal-body {
    mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 100%);
    -webkit-mask-image: linear-gradient(
        to bottom,
        transparent 0,
        #000 14%,
        #000 100%
    );
    transition:
        opacity 550ms cubic-bezier(0.4, 0, 0.2, 1),
        transform 550ms cubic-bezier(0.4, 0, 0.2, 1),
        filter 550ms cubic-bezier(0.4, 0, 0.2, 1);
}
.compare.is-animating.is-wiping .terminal-body {
    opacity: 0;
    transform: translateY(-14px) scale(0.985);
    filter: blur(2px);
}

.terminal-body .ok {
    color: #8bb38b;
    font-weight: 600;
}
.terminal-body .write-line {
    display: inline-block;
    color: #d4a05a;
    background: rgba(212, 160, 90, 0.18);
    padding: 0.1em 0.45em;
    margin: 0 -0.45em;
    border-left: 2px solid #d4a05a;
    box-shadow: 0 0 14px rgba(212, 160, 90, 0.22);
}
.compare.is-animating .terminal-body .write-line {
    animation: writeFlash 900ms ease-out 1;
}
@keyframes writeFlash {
    0% {
        background: rgba(212, 160, 90, 0);
        box-shadow: 0 0 0 rgba(212, 160, 90, 0);
    }
    25% {
        background: rgba(212, 160, 90, 0.5);
        box-shadow: 0 0 28px rgba(212, 160, 90, 0.55);
    }
    100% {
        background: rgba(212, 160, 90, 0.18);
        box-shadow: 0 0 14px rgba(212, 160, 90, 0.22);
    }
}

/* Desktop only: dim the FolderMD column while the agent is working,
   restore to full brightness when the document is revealed. Keeps focus
   on the terminal during the streaming/wipe phases so the reveal lands harder. */
@media (min-width: 900px) {
    .compare-wrap .compare-col:nth-child(2) {
        transition:
            opacity 600ms cubic-bezier(0.2, 0.7, 0.2, 1),
            filter 600ms cubic-bezier(0.2, 0.7, 0.2, 1);
    }
    .compare.is-animating:not(.is-revealed)
        .compare-wrap
        .compare-col:nth-child(2) {
        opacity: 0.38;
        filter: grayscale(55%);
    }
    .compare.is-animating.is-revealed
        .compare-wrap
        .compare-col:nth-child(2) {
        opacity: 1;
        filter: none;
    }
}

/* reader: document fades in when reveal triggers */
.compare .preview-reader {
    position: relative;
}
.compare .preview-reader .reader-document {
    opacity: 1;
}
.compare.is-animating .preview-reader .reader-document {
    opacity: 0;
    transform: translateY(6px);
    transition:
        opacity 700ms ease,
        transform 700ms ease;
}
.compare.is-animating.is-revealed .preview-reader .reader-document {
    opacity: 1;
    transform: translateY(0);
}

/* sidebar "incoming" state: dim the active item until reveal */
.compare.is-animating .preview-sidebar .js-incoming {
    opacity: 0.35;
    transition:
        opacity 600ms ease,
        background 600ms ease;
    background: transparent;
}
.compare.is-animating.is-revealed .preview-sidebar .js-incoming {
    opacity: 1;
    background: var(--paper);
    animation: incomingPop 600ms cubic-bezier(0.2, 0.7, 0.2, 1) 1;
}
@keyframes incomingPop {
    0% {
        transform: translateY(-4px);
    }
    100% {
        transform: translateY(0);
    }
}

/* ──────────────────────────────────────────────── changelog */

.changelog-header {
    max-width: var(--measure);
    margin: 0 auto 4rem;
    text-align: center;
}
.changelog-header h1 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2.6rem, 6vw + 1rem, 4rem);
    line-height: 1.05;
    letter-spacing: -0.018em;
    margin-bottom: 1rem;
}
.changelog-sub {
    font-family: var(--serif);
    font-size: 1.05rem;
    line-height: 1.55;
    color: var(--muted);
    max-width: 34rem;
    margin: 0 auto;
}
.changelog-sub a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--oxblood);
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}
.changelog-sub a:hover {
    color: var(--oxblood);
}

.changelog-timeline {
    max-width: 42rem;
    margin: 0 auto;
    position: relative;
}
/* Vertical timeline line — runs the full length of the timeline column,
   sits behind the entry markers. */
.changelog-timeline::before {
    content: "";
    position: absolute;
    left: 0.42rem;
    top: 0.6rem;
    bottom: 1rem;
    width: 1px;
    background: var(--hair);
}

.changelog-entry {
    position: relative;
    padding-left: 2.5rem;
    padding-bottom: 4rem;
}
.changelog-entry:last-child {
    padding-bottom: 1rem;
}
.changelog-entry-marker {
    position: absolute;
    left: 0;
    top: 0.55rem;
    width: 0.95rem;
    height: 0.95rem;
    border-radius: 50%;
    background: var(--paper);
    border: 2px solid var(--oxblood);
    box-sizing: border-box;
    z-index: 1;
}
.changelog-entry-meta {
    display: flex;
    align-items: baseline;
    gap: 0.85rem;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
}
.changelog-version {
    font-family: var(--mono);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--oxblood);
    background: color-mix(in srgb, var(--oxblood) 10%, transparent);
    padding: 0.18rem 0.55rem;
    border-radius: 3px;
    letter-spacing: 0.02em;
}
.changelog-version--initial {
    color: var(--paper);
    background: var(--oxblood);
}
.changelog-entry-meta time {
    font-family: var(--serif);
    font-style: italic;
    font-size: 0.9rem;
    color: var(--muted);
}

.changelog-entry h2 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 1.7rem;
    line-height: 1.18;
    letter-spacing: -0.012em;
    margin: 0 0 1.1rem;
}
.changelog-entry h2 em {
    font-style: italic;
    color: var(--oxblood);
}
.changelog-entry h3 {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 1.05rem;
    margin: 1.8rem 0 0.55rem;
    letter-spacing: -0.005em;
}
.changelog-entry p {
    font-size: 1.02rem;
    line-height: 1.7;
    margin-bottom: 0.95rem;
    color: var(--ink);
}
.changelog-entry p em {
    font-style: italic;
}
.changelog-entry ul {
    padding-left: 1.4rem;
    margin: 0.6rem 0 1rem;
}
.changelog-entry ul li {
    font-size: 1.02rem;
    line-height: 1.7;
    margin-bottom: 0.4rem;
    list-style: disc;
}
.changelog-entry code {
    font-family: var(--mono);
    font-size: 0.9em;
    background: var(--paper-deep);
    padding: 0.08em 0.32em;
    border-radius: 2px;
    color: var(--ink);
}
.changelog-entry a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--oxblood);
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}
.changelog-entry a:hover {
    color: var(--oxblood);
}

/* Author-note callout — used at the bottom of an entry for a personal aside */
.changelog-author-note {
    margin: 1.5rem 0 0;
    padding: 1rem 1.25rem;
    border-left: 2px solid var(--oxblood);
    background: var(--paper-deep);
    font-style: italic;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.65;
}

@media (max-width: 700px) {
    .changelog-entry { padding-left: 1.85rem; padding-bottom: 3rem; }
    .changelog-entry h2 { font-size: 1.45rem; }
    .changelog-timeline::before { left: 0.34rem; }
    .changelog-entry-marker { width: 0.8rem; height: 0.8rem; }
}

/* ──────────────────────────────────────────────── mobile nav toggle */

/* Hidden on desktop — the regular .nav row takes care of layout. The
   button shows up below 700px where the four nav items would otherwise
   wrap or get squeezed below the brand. */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--ink);
    cursor: pointer;
    padding: 0.4rem;
    margin: -0.4rem 0;
    line-height: 0;
    border-radius: 4px;
    transition: color 200ms ease;
}
.nav-toggle:hover { color: var(--oxblood); }
.nav-toggle:focus-visible {
    outline: 2px solid var(--oxblood);
    outline-offset: 2px;
}
.nav-toggle .nt-line {
    transform-origin: center;
    transition:
        transform 200ms cubic-bezier(0.2, 0.7, 0.2, 1),
        opacity 200ms ease;
}

@media (max-width: 700px) {
    .masthead {
        flex-wrap: wrap;
        align-items: center;
    }
    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    /* Hidden by default on mobile; revealed when the masthead has
       .is-nav-open (toggled in analytics.js). Drops down on its own row
       below the brand row, items stacked vertically and right-aligned to
       mirror the desktop layout's flow direction. */
    .nav {
        display: none;
        flex-basis: 100%;
        flex-direction: column;
        align-items: flex-end;
        gap: 1.1rem;
        padding: 1rem 0 0.25rem;
        margin-top: 0.5rem;
        border-top: 1px solid var(--hair);
    }
    .masthead.is-nav-open .nav { display: flex; }
    /* Bigger tap targets in the open state */
    .masthead.is-nav-open .nav a {
        font-size: 0.95rem;
        padding: 0.35rem 0;
    }
    /* Hamburger morphs into an X when open */
    .masthead.is-nav-open .nt-line-1 { transform: translateY(6px) rotate(45deg); }
    .masthead.is-nav-open .nt-line-2 { opacity: 0; }
    .masthead.is-nav-open .nt-line-3 { transform: translateY(-6px) rotate(-45deg); }
}

/* ──────────────────────────────────────────────── skills index grid */

/* Reset the prose-list bullet/counter styling for the agent grid — we want
   a real card grid here, not numbered or bulleted text. */
.prose .skill-grid {
    list-style: none;
    padding: 0;
    counter-reset: none;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.8rem;
    margin: 1.5rem 0 2rem;
}
@media (min-width: 700px) {
    .prose .skill-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
}
.prose .skill-grid > li {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-increment: none;
}
.prose .skill-grid > li::before { content: none; }
.prose .skill-grid > li > a {
    display: block;
    padding: 1rem 1.1rem;
    border: 1px solid var(--hair);
    background: var(--paper);
    text-decoration: none;
    transition:
        border-color 200ms ease,
        background 200ms ease,
        transform 200ms ease;
}
.prose .skill-grid > li > a:hover {
    border-color: var(--oxblood);
    background: var(--paper-deep);
    text-decoration: none;
    transform: translateY(-1px);
}
.prose .skill-grid strong {
    display: block;
    font-family: var(--serif);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--ink);
    margin-bottom: 0.2rem;
}
.prose .skill-grid .skill-path {
    display: block;
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--oxblood);
    margin-bottom: 0.45rem;
}
.prose .skill-grid .skill-blurb {
    display: block;
    font-family: var(--serif);
    font-size: 0.92rem;
    line-height: 1.45;
    color: var(--muted);
}

/* Eyebrow link above the H1 on individual skill pages — back-to-index nav */
.lede .eyebrow {
    font-family: var(--serif);
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.6rem;
    letter-spacing: 0.02em;
}
.lede .eyebrow a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted var(--muted);
    transition: color 200ms ease, border-color 200ms ease;
}
.lede .eyebrow a:hover {
    color: var(--oxblood);
    border-bottom-color: var(--oxblood);
}

/* Visually hidden but readable by AI agents and screen readers */
.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;
}
