@font-face {
    font-family: 'Winchester Custom';
    src: local('Winchester New ITC Std'),
         local('Winchester New ITC Std Font'),
         url('../../font/winchester-new-itc-std-book.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --f: "Winchester Custom", "Winchester New ITC Std", Garamond, serif;
    --mono: "SFMono-Regular", "SF Mono", "Cascadia Code", "JetBrains Mono", "Fira Code", "Menlo", monospace;
    --bg: #0e0e0e;
    --text: #e0e0e0;
    --dim: #b8b3b3;
    --faded: #6b6666;
    --accent: #c45050;
    --accent-h: #d86464;
    --code-bg: #141111;
    --code-edge: rgba(212, 100, 100, 0.2);
    --code-line: rgba(255, 255, 255, 0.08);
    --code-text: #f5ece7;
    --code-muted: #b5968f;
}

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

body {
    background: var(--bg);
    color: var(--dim);
    font-family: var(--f);
    font-size: 24px;
    line-height: 1.7;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    display: flex;
    justify-content: center;
    padding: 10vh 24px 12vh;
    overflow-x: hidden;
}

::selection {
    background: var(--accent);
    color: var(--bg);
}

.page {
    max-width: 840px;
    width: 100%;
    transition: filter 0.4s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
}

body.cmd-active .page {
    filter: blur(5px);
    transform: scale(0.97) translateY(-10px);
    opacity: 0.3;
    pointer-events: none;
}

.rv {
    opacity: 0;
    transform: translateY(10px);
    animation: up 1.1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

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

.r1 { animation-delay: 0.05s; }
.r2 { animation-delay: 0.2s; }
.r3 { animation-delay: 0.35s; }

.header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 48px;
}

.avatar-wrap {
    flex-shrink: 0;
    width: 96px;
    height: 96px;
    position: relative;
}

.avatar-wrap::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent), rgba(196, 80, 80, 0.15));
    opacity: 0;
    transition: opacity 0.5s ease;
}

.avatar-wrap:hover::before {
    opacity: 1;
}

.avatar {
    width: 96px;
    height: 96px;
    border-radius: 14px;
    object-fit: cover;
    filter: grayscale(0.3) contrast(1.05);
    position: relative;
    z-index: 1;
    transition: filter 0.5s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.avatar:hover {
    filter: grayscale(0) contrast(1.08);
    transform: scale(1.03);
}

.name {
    font-weight: 400;
    font-size: 57px;
    letter-spacing: -0.035em;
    line-height: 1.05;
    color: var(--text);
    margin-bottom: 6px;
}

.tag {
    font-size: 22px;
    font-style: italic;
    color: var(--faded);
    margin-bottom: 0;
    line-height: 1.4;
}

.tag .ac {
    color: var(--accent);
}

p {
    margin-bottom: 27px;
}

strong {
    color: var(--text);
    font-weight: 400;
}

.pl {
    color: var(--accent);
    text-decoration: none;
    position: relative;
    transition: color 0.2s;
}

.pl::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.pl:hover::after {
    transform: scaleX(1);
}

.pl:hover {
    color: var(--accent-h);
}

.pl .arr {
    display: inline-block;
    width: 15px;
    height: 15px;
    margin-left: 3px;
    vertical-align: middle;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    top: -1px;
}

.pl:hover .arr {
    transform: translate(2px, -2px);
}

.ml {
    color: var(--dim);
    text-decoration: none;
    position: relative;
    transition: color 0.2s;
}

.ml::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--dim);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.ml:hover {
    color: var(--text);
}

.ml:hover::after {
    transform: scaleX(1);
}

.cmdk {
    color: var(--accent);
    background: rgba(196, 80, 80, 0.07);
    padding: 2px 10px;
    border-radius: 5px;
    border: 1px solid rgba(196, 80, 80, 0.12);
    font-family: var(--f);
    font-size: 0.88em;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.cmdk:hover {
    background: rgba(196, 80, 80, 0.13);
    border-color: rgba(196, 80, 80, 0.25);
}

.section-note,
.meta-date,
.post-meta,
.cmd-result-meta,
.cmd-empty {
    font-size: 22px;
    font-style: italic;
    color: var(--faded);
}

.section-note {
    margin-bottom: 18px;
}

.summary-sep {
    color: var(--faded);
}

.post-title {
    font-weight: 400;
    font-size: 57px;
    letter-spacing: -0.035em;
    line-height: 1.05;
    color: var(--text);
    margin-bottom: 10px;
}

.article h2,
.article h3,
.article h4 {
    color: var(--text);
    font-weight: 400;
    line-height: 1.08;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}

.article h2 {
    font-size: 44px;
    margin-top: 44px;
}

.article h3 {
    font-size: 34px;
    margin-top: 36px;
}

.article h4 {
    font-size: 28px;
    margin-top: 32px;
}

.article ul,
.article ol {
    margin: 0 0 27px 28px;
}

.article li {
    margin-bottom: 8px;
}

.article blockquote {
    border-left: 1px solid rgba(196, 80, 80, 0.4);
    padding-left: 18px;
    color: var(--text);
    font-style: italic;
    margin-bottom: 27px;
}

.article code {
    color: #f1c4b8;
    background: rgba(196, 80, 80, 0.12);
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(212, 100, 100, 0.16);
    font-family: var(--mono);
    font-size: 0.76em;
}

.article pre,
.article pre.code-block {
    position: relative;
    margin-bottom: 27px;
    overflow-x: auto;
    padding: 54px 22px 22px;
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(212, 100, 100, 0.12), rgba(212, 100, 100, 0.02) 72px),
        var(--code-bg);
    border: 1px solid var(--code-edge);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.03),
        0 20px 40px rgba(0, 0, 0, 0.28);
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 100, 100, 0.45) transparent;
}

.article pre.code-block::before {
    content: attr(data-language);
    position: absolute;
    top: 16px;
    left: 18px;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--code-muted);
}

.article pre.code-block::after {
    content: '';
    position: absolute;
    top: 18px;
    right: 18px;
    width: 11px;
    height: 11px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow:
        -20px 0 0 rgba(255, 255, 255, 0.16),
        -40px 0 0 rgba(255, 255, 255, 0.08);
}

.article pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: var(--code-text);
    display: block;
    font-family: var(--mono);
    font-size: 0.76em;
    line-height: 1.85;
    white-space: pre;
    min-width: max-content;
}

.article pre code::selection {
    background: rgba(212, 100, 100, 0.28);
    color: var(--code-text);
}

.article hr {
    border: none;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 32px 0;
}

#cmd-layer {
    position: fixed;
    top: 14vh;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    width: 100%;
    max-width: 840px;
    padding: 0 24px;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

body.cmd-active #cmd-layer {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.cmd-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-family: var(--f);
    font-size: 39px;
    line-height: 1.2;
    padding: 0;
    margin-bottom: 30px;
}

.cmd-input::placeholder {
    color: var(--faded);
}

.cmd-response {
    font-size: 24px;
    color: var(--dim);
    line-height: 1.7;
}

.cmd-result {
    display: block;
    color: var(--dim);
    text-decoration: none;
    margin-bottom: 10px;
    transition: color 0.2s;
}

.cmd-result:last-child {
    margin-bottom: 0;
}

.cmd-result-label {
    color: inherit;
}

.cmd-result-meta {
    margin-left: 10px;
}

.cmd-result.is-active,
.cmd-result:hover {
    color: var(--text);
}

.cmd-result.is-active .cmd-result-label,
.cmd-result:hover .cmd-result-label {
    color: var(--accent);
}

@media (max-width: 600px) {
    body {
        font-size: 16px;
        padding-top: 8vh;
    }

    .name,
    .post-title {
        font-size: 30px;
    }

    .tag,
    .section-note,
    .meta-date,
    .post-meta,
    .cmd-result-meta,
    .cmd-empty {
        font-size: 15px;
    }

    .cmd-input {
        font-size: 22px;
    }

    .avatar-wrap,
    .avatar {
        width: 54px;
        height: 54px;
        border-radius: 10px;
    }

    .page {
        max-width: 560px;
    }

    .header {
        gap: 16px;
        margin-bottom: 32px;
    }

    p {
        margin-bottom: 18px;
    }

    .pl .arr {
        width: 10px;
        height: 10px;
    }

    .cmd-response {
        font-size: 16px;
    }

    .article h2 {
        font-size: 28px;
        margin-top: 30px;
    }

    .article h3 {
        font-size: 22px;
        margin-top: 24px;
    }

    .article h4 {
        font-size: 18px;
        margin-top: 22px;
    }

    .article pre,
    .article pre.code-block {
        padding: 46px 16px 16px;
        border-radius: 14px;
    }

    .article pre code {
        font-size: 0.7em;
    }

    #cmd-layer {
        max-width: 560px;
    }
}
