@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700;800&display=swap');

@font-face {
    font-family: 'Anthropic Sans';
    src: url('/fonts/AnthropicSans-Roman.woff2') format('woff2');
    font-weight: 300 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Anthropic Sans';
    src: url('/fonts/AnthropicSans-Italic.woff2') format('woff2');
    font-weight: 300 800;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Anthropic Serif';
    src: url('/fonts/AnthropicSerif-Roman.woff2') format('woff2');
    font-weight: 300 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Anthropic Serif';
    src: url('/fonts/AnthropicSerif-Italic.woff2') format('woff2');
    font-weight: 300 800;
    font-style: italic;
    font-display: swap;
}

:root {
    --site-accent: #111111;
    --site-accent-link: #5f5f5f;
    --site-accent-strong: rgba(17, 17, 17, 0.72);
    --site-accent-soft: rgba(17, 17, 17, 0.12);
    --site-accent-contrast: #ffffff;
    --article-sort-line-color: rgba(17, 17, 17, 0.2);
    --article-sort-node-color: #111111;
    --article-sort-node-hover-color: rgba(17, 17, 17, 0.58);
    --text-bg-hover: var(--site-accent-soft);
    --btn-hover-color: var(--site-accent-strong);
    --text-highlight-color: var(--site-accent);
    --pseudo-hover: var(--site-accent-strong);
    --default-bg-color: var(--site-accent);
    --scrollbar-color: var(--site-accent);
    --tags-blue-color: var(--site-accent);
    --tags-blue-color-lighten: var(--site-accent-soft);
    --note-info-border: var(--site-accent);
    --note-info-bg: var(--site-accent-soft);
    --note-info-text: var(--site-accent);
    --note-modern-info-border: var(--site-accent);
    --note-modern-info-bg: var(--site-accent-soft);
    --note-modern-info-text: var(--site-accent);
    --note-modern-info-hover: var(--site-accent-strong);
    --timeline-color: var(--site-accent);
    --timeline-bg: var(--site-accent-soft);
    --waline-theme-color: var(--site-accent);
    --waline-active-color: var(--site-accent-strong);
}

[data-theme='dark'] {
    --site-accent: rgba(255, 255, 255, 0.9);
    --site-accent-link: rgba(255, 255, 255, 0.72);
    --site-accent-strong: rgba(255, 255, 255, 0.28);
    --site-accent-soft: rgba(255, 255, 255, 0.12);
    --site-accent-contrast: #111111;
    --article-sort-line-color: rgba(255, 255, 255, 0.24);
    --article-sort-node-color: rgba(255, 255, 255, 0.9);
    --article-sort-node-hover-color: rgba(255, 255, 255, 0.55);
    --text-bg-hover: var(--site-accent-soft);
    --btn-hover-color: var(--site-accent-strong);
    --text-highlight-color: var(--site-accent);
    --pseudo-hover: rgba(255, 255, 255, 0.55);
    --default-bg-color: var(--site-accent);
    --scrollbar-color: rgba(255, 255, 255, 0.55);
    --tags-blue-color: var(--site-accent);
    --tags-blue-color-lighten: var(--site-accent-soft);
    --note-info-border: var(--site-accent);
    --note-info-bg: var(--site-accent-soft);
    --note-info-text: var(--site-accent);
    --note-modern-info-border: var(--site-accent);
    --note-modern-info-bg: var(--site-accent-soft);
    --note-modern-info-text: var(--site-accent);
    --note-modern-info-hover: rgba(255, 255, 255, 0.42);
    --timeline-color: var(--site-accent);
    --timeline-bg: var(--site-accent-soft);
    --waline-theme-color: var(--site-accent);
    --waline-active-color: rgba(255, 255, 255, 0.42);
}

*::selection {
    background: var(--site-accent) !important;
    color: var(--site-accent-contrast) !important;
}

a {
    color: var(--site-accent-link);
}

a:hover {
    color: var(--site-accent) !important;
}

#nav .site-page:not(.child)::after {
    display: none !important;
    background: transparent !important;
}

blockquote {
    border-left-color: var(--site-accent) !important;
}

.category-lists .category-list a:hover,
#aside-content a:hover,
#card-toc .toc-link:hover,
#card-toc .toc-link.active,
#article-container .shuoshuo-footer .shuoshuo-comment-btn:hover {
    color: var(--site-accent) !important;
}

#nav a:hover,
#nav span.site-page:hover,
#nav #toggle-menu:hover,
#nav #blog-info:hover {
    color: var(--white) !important;
}

#page-header.not-top-img #nav a:hover,
#page-header.not-top-img #nav span.site-page:hover,
#page-header.not-top-img #nav #toggle-menu:hover,
#page-header.not-top-img #nav #blog-info:hover {
    color: var(--site-accent) !important;
}

#page-header.nav-fixed #nav a:hover,
#page-header.nav-fixed #nav span.site-page:hover,
#page-header.nav-fixed #nav #toggle-menu:hover,
#page-header.nav-fixed #nav #blog-info:hover {
    color: var(--site-accent) !important;
}

.site-data > a:hover div {
    color: var(--site-accent) !important;
}

#rightside > div > button,
#rightside > div > a {
    background-color: var(--site-accent) !important;
    color: var(--site-accent-contrast) !important;
}

#rightside > div > button:hover,
#rightside > div > a:hover {
    background-color: var(--site-accent-strong) !important;
    color: var(--site-accent-contrast) !important;
}

#lang-en,
#lang-cn {
    font-size: 0.82rem !important;
    font-weight: 700;
    letter-spacing: 0.08em;
}

#lang-en span,
#lang-cn span {
    display: inline-block;
    transform: translateX(0.04em);
}

.social-icon .fa-envelope,
#page-header .social-icon .fa-envelope,
#aside-content .card-info-social-icons .fa-envelope {
    color: #4a7dbe !important;
}

#pagination .page-number.current {
    background: var(--site-accent) !important;
    color: var(--site-accent-contrast) !important;
}

#aside-content .card-archives ul.card-archive-list > .card-archive-list-item a:hover,
#aside-content .card-categories ul.card-category-list > .card-category-list-item a:hover {
    background-color: var(--site-accent-soft) !important;
    color: var(--site-accent) !important;
}

#aside-content .card-tag-cloud a {
    color: #999 !important;
    font-size: 1.1em !important;
}

#aside-content .card-tag-cloud a:hover,
#aside-content .aside-list > .aside-list-item .content > .title:hover,
#aside-content .aside-list > .aside-list-item .content > .comment:hover {
    color: var(--site-accent) !important;
}

#article-container .shuoshuo-footer .shuoshuo-tag {
    border-color: var(--site-accent) !important;
    color: var(--site-accent) !important;
}

#article-container .shuoshuo-footer .shuoshuo-tag:hover {
    background: var(--site-accent) !important;
    color: var(--site-accent-contrast) !important;
}

body[data-type="archive"] .article-sort,
body[data-type="tag"] .article-sort {
    border-left-color: var(--article-sort-line-color) !important;
}

body[data-type="archive"] .article-sort-title::before,
body[data-type="archive"] .article-sort-item::before,
body[data-type="tag"] .article-sort-title::before,
body[data-type="tag"] .article-sort-item::before {
    border-color: var(--article-sort-node-color) !important;
}

body[data-type="archive"] .article-sort-title::after,
body[data-type="tag"] .article-sort-title::after {
    background: var(--article-sort-line-color) !important;
}

body[data-type="archive"] .article-sort-title:hover::before,
body[data-type="archive"] .article-sort-item:hover::before,
body[data-type="tag"] .article-sort-title:hover::before,
body[data-type="tag"] .article-sort-item:hover::before {
    border-color: var(--article-sort-node-hover-color) !important;
}

body[data-type="archive"] .article-sort-item.year::before,
body[data-type="archive"] .article-sort-item.year:hover::before,
body[data-type="tag"] .article-sort-item.year::before,
body[data-type="tag"] .article-sort-item.year:hover::before {
    border-color: var(--article-sort-node-color) !important;
}

.search-dialog {
    font-size: 1.35rem;
    --hr-border: var(--site-accent-soft);
    --hr-before-color: var(--site-accent);
}

.search-dialog input,
.search-dialog .ais-SearchBox-input,
.search-dialog button {
    font: inherit;
}

.search-dialog .search-nav,
.search-dialog .search-nav .search-close-button:hover,
.search-dialog .search-result-list .local-search-hit-item[value]::before,
.search-dialog .ais-Hits-list .local-search-hit-item[value]::before,
.search-dialog .search-result-list .ais-Hits-item[value]::before,
.search-dialog .ais-Hits-list .ais-Hits-item[value]::before,
.search-dialog .search-result-list .local-search-hit-item a:hover,
.search-dialog .ais-Hits-list .local-search-hit-item a:hover,
.search-dialog .search-result-list .ais-Hits-item a:hover,
.search-dialog .ais-Hits-list .ais-Hits-item a:hover,
.search-dialog .search-keyword,
.search-dialog hr::before {
    color: var(--site-accent) !important;
}

.search-dialog .local-search-input input,
.search-dialog #algolia-search-input input,
.search-dialog .local-search-input .ais-SearchBox-input,
.search-dialog #algolia-search-input .ais-SearchBox-input {
    border-color: var(--site-accent) !important;
    box-shadow: none !important;
}

.search-dialog .local-search-input input:focus,
.search-dialog #algolia-search-input input:focus,
.search-dialog .local-search-input .ais-SearchBox-input:focus,
.search-dialog #algolia-search-input .ais-SearchBox-input:focus {
    border-color: var(--site-accent) !important;
    box-shadow: 0 0 0 1px var(--site-accent-soft) !important;
}

/* Hide content below the cover on homepage */
body[data-type="home"] #content-inner,
body[data-type="home"] #footer,
body[data-type="home"] #rightside,
body[data-type="home"] #scroll-down {
    display: none !important;
}

/* Fix homepage layout and fonts */
body[data-type="home"] {
    overflow: hidden;
    /* Remove scrollbar/white strip */
    font-size: 1.35rem;
    /* Increase global font size on homepage */
}

/* Increase Top Nav font size */
#nav .site-page,
#nav .site-name {
    font-size: 1.5rem !important;
}

/* Match anthropic.com header typography — Anthropic Sans for logo and top nav */
#nav .site-name,
#nav #blog-info,
#nav .site-page,
#sidebar-menus .menus_item a {
    font-family: 'Anthropic Sans', Arial, sans-serif !important;
}

/* Keep the top navigation text-only without affecting the mobile menu toggle */
#nav #search-button i,
#nav #menus .menus_items > .menus_item > a.site-page > i,
#nav #menus .menus_items > .menus_item > span.site-page.group > i.fa-fw,
#nav #menus .menus_item_child a.site-page.child > i {
    display: none !important;
}

/* Nav hamburger dropdown (language + dark mode). The bars icon should remain
   visible even though other nav icons are hidden. */
#nav #menus #nav-extras {
    display: inline;
}

#nav #menus #nav-extras > .menus_item > span.site-page.group > i.fa-bars.nav-extras-icon {
    display: inline-block !important;
    padding-right: 0;
    font-size: 1.25rem;
}

#nav #menus #nav-extras > .menus_item > span.site-page.group > i.fa-chevron-down {
    display: none !important;
}

#nav #menus #nav-extras > .menus_item > span.site-page.group {
    cursor: pointer;
}

#nav #menus #nav-extras .menus_item_child {
    min-width: 140px;
}

#nav #menus #nav-extras .menus_item_child a.site-page.child {
    cursor: pointer;
    text-align: center;
}

/* Article-page TOC button on the right side: always visible on post pages
   at all viewport sizes (the theme hides it above 900px by default). */
body[data-type="post"] #rightside #mobile-toc-button {
    display: block !important;
}

/* On non-post pages the TOC button should never appear, even if the theme
   emits it (safety net). */
body:not([data-type="post"]) #rightside #mobile-toc-button {
    display: none !important;
}

/* Force the rightside container to stay visible throughout the whole post —
   by default Butterfly only shows it at the very top and very bottom of the
   page (see scrollFn in main.js → .rightside-show toggle). */
body[data-type="post"] #rightside {
    opacity: 0.8 !important;
    transform: translate(-58px, 0) !important;
}

/* On post pages the TOC is a floating overlay, triggered by the rightside
   button. The aside no longer occupies flex space in the article layout so
   the article column (kept at its original 74% width) is horizontally
   centered instead of being pushed left by the empty sidebar gutter.
   #card-toc stays in the DOM (needed by the click handler) but is anchored
   to the viewport with the same scale(0)/scale(1) animation the theme uses
   at ≤900px. */
body[data-type="post"] #content-inner.layout {
    justify-content: center;
}

body[data-type="post"] #content-inner.layout > #aside-content {
    flex: 0 0 0 !important;
    width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
}

body[data-type="post"] #card-toc {
    position: fixed !important;
    right: 55px !important;
    bottom: 30px !important;
    z-index: 100 !important;
    width: 380px !important;
    max-width: calc(100vw - 90px) !important;
    max-height: calc(100vh - 120px) !important;
    margin: 0 !important;
    transform: scale(0);
    transform-origin: right bottom;
    transition: transform 0.3s ease-in-out;
}

body[data-type="post"] #card-toc.open {
    transform: scale(1);
}

/* Ensure subtitle is visible and sized */
#site-subtitle {
    display: block !important;
    font-size: 1.5em !important;
}

#site-subtitle span {
    display: inline-block !important;
    /* Fix cursor dropping to new line */
}

/* Disable avatar rotation */
.avatar-img img {
    transform: none !important;
    transition: none !important;
}

/* Hide all sidebar widgets on post pages except TOC */
body[data-type="post"] #aside-content .card-widget:not(#card-toc) {
    display: none !important;
}

/* Hide the entire aside on article list pages (category/tag/archive).
   The Movie list already hides it via .is-movie-post elsewhere; this covers
   the Tech list and other index-style pages. Expand content to full width. */
body[data-type="category"] #aside-content,
body[data-type="cat_index"] #aside-content,
body[data-type="tag"] #aside-content,
body[data-type="archive"] #aside-content,
body[data-type="page"] #aside-content {
    display: none !important;
}

body[data-type="category"] #content-inner.layout > div:first-child,
body[data-type="cat_index"] #content-inner.layout > div:first-child,
body[data-type="tag"] #content-inner.layout > div:first-child,
body[data-type="archive"] #content-inner.layout > div:first-child,
body[data-type="page"] #content-inner.layout > div:first-child {
    width: 100% !important;
}

/* Strip Font Awesome icons from the article-list card meta row so only
   the "Created <date> | Tech" text remains. */
.recent-post-item .article-meta-wrap i.far,
.recent-post-item .article-meta-wrap i.fas {
    display: none !important;
}

/* Same treatment for the post page header meta row under the title. */
#post-meta .post-meta-icon {
    display: none !important;
}

/* Hide the bottom tag list on all post pages (Tech and Movie). */
#post .tag_share .post-meta__tag-list {
    display: none !important;
}

/* TOC active item: drop the green background, keep only a colored highlight. */
#card-toc .toc-content .toc-link.active {
    background: transparent !important;
    color: var(--site-accent) !important;
    font-weight: 600;
}

/* Movie article pages get a clean A24-like hero without the default overlay metadata */
#body-wrap.is-movie-post #page-header.post-bg {
    height: clamp(460px, 72vh, 860px);
    min-height: 520px;
    background-position: center 24%;
}

#body-wrap.is-movie-post #page-header.post-bg #post-info {
    display: none !important;
}

#body-wrap.is-movie-post #content-inner > #post {
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

#body-wrap.is-movie-post #post > .movie-article-intro {
    margin: 0 0 clamp(32px, 5vw, 56px);
    max-width: 1100px;
}

#body-wrap.is-movie-post .movie-article-kicker {
    margin: 0 0 18px;
    color: #7a7a7a;
    font: 600 0.94rem/1.2 'Archivo', sans-serif;
    letter-spacing: 0.03em;
}

#body-wrap.is-movie-post .movie-article-title {
    margin: 0;
    color: #111111;
    font-family: 'Archivo', sans-serif;
    font-size: clamp(3rem, 6.2vw, 5.75rem);
    font-weight: 400;
    line-height: 0.9;
    letter-spacing: -0.06em;
    text-wrap: balance;
}

#body-wrap.is-movie-post #post #article-container {
    margin-top: 0;
}

#body-wrap.is-movie-post #post #article-container > :first-child {
    margin-top: 0;
}

[data-theme='dark'] #body-wrap.is-movie-post .movie-article-kicker {
    color: rgba(255, 255, 255, 0.52);
}

[data-theme='dark'] #body-wrap.is-movie-post .movie-article-title {
    color: rgba(255, 255, 255, 0.92);
}

:root {
    --post-tag-color: #111111;
    --post-tag-hover-bg: rgba(17, 17, 17, 0.12);
    --post-tag-hover-border: rgba(17, 17, 17, 0.65);
}

[data-theme='dark'] {
    --post-tag-color: rgba(255, 255, 255, 0.86);
    --post-tag-hover-bg: rgba(255, 255, 255, 0.14);
    --post-tag-hover-border: rgba(255, 255, 255, 0.5);
}

#post .post-meta__tags {
    border-color: var(--post-tag-color) !important;
    color: var(--post-tag-color) !important;
}

#post .post-meta__tags:hover {
    background: var(--post-tag-hover-bg) !important;
    border-color: var(--post-tag-hover-border) !important;
    color: var(--post-tag-color) !important;
}

@media screen and (max-width: 900px) {
    #body-wrap.is-movie-post #page-header.post-bg {
        height: clamp(320px, 54vh, 480px);
        min-height: 320px;
        background-position: center center;
    }

    #body-wrap.is-movie-post #post > .movie-article-intro {
        margin-bottom: 32px;
    }

    #body-wrap.is-movie-post .movie-article-title {
        font-size: clamp(2.5rem, 12vw, 4rem);
        letter-spacing: -0.05em;
    }
}

/* Music Player Styles */
/* Music Player Styles */
/* High specificity to override theme defaults */
#menus .menus_item_child li a.playing,
#menus .menus_item_child li a.playing span,
#menus .menus_item_child li a.playing i,
#sidebar-menus .menus_item_child li a.playing,
#sidebar-menus .menus_item_child li a.playing span,
#sidebar-menus .menus_item_child li a.playing i {
    color: var(--site-accent) !important;
    font-weight: bold !important;
}

.waveform {
    display: inline-flex;
    align-items: flex-end;
    justify-content: space-between;
    width: 13px;
    height: 13px;
    margin-left: 8px;
}

.wave-bar {
    width: 3px;
    background-color: var(--site-accent);
    animation: wave-animation 1s infinite ease-in-out;
}

/* Lock article page content width — on large/fullscreen viewports, expand side margins instead of widening the article body. */
@media screen and (min-width: 1600px) {
    #body-wrap.post:not(.is-movie-post) #content-inner.layout {
        max-width: 1200px;
    }
}

/* Article header banner — shaped for 21:9 cover images.
   Container takes a 21:9 aspect ratio so the full image displays without cropping.
   On very wide screens the container is capped at max-height; any overflow crops
   from the bottom since background-position anchors to the top. */
#body-wrap.post #page-header.post-bg {
    height: auto !important;
    aspect-ratio: 21 / 9;
    max-height: 720px;
    background-position: center top !important;
    background-size: cover !important;
}

@media screen and (max-width: 768px) {
    #body-wrap.post #page-header.post-bg {
        height: auto !important;
        aspect-ratio: 21 / 9;
        max-height: none;
    }
}

.wave-bar:nth-child(1) {
    animation-delay: 0s;
}

.wave-bar:nth-child(2) {
    animation-delay: 0.2s;
}

.wave-bar:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes wave-animation {

    0%,
    100% {
        height: 2px;
    }

    50% {
        height: 100%;
    }
}

/* Footer Customization */
#footer {
    background: transparent !important;
    background-color: transparent !important;
}

/* Let footer text follow the current theme when the footer is transparent */
#footer .footer-other,
#footer .footer-other span,
#footer .footer-other a {
    color: var(--font-color) !important;
}

#footer .footer-other a:hover {
    color: var(--default-bg-color) !important;
}

/* Custom Scrollbar - YouTube Style */
::-webkit-scrollbar {
    width: 16px;
    height: 16px;
}

::-webkit-scrollbar-track {
    background-color: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: #909090;
    border-radius: 8px;
    border: 4px solid transparent;
    background-clip: content-box;
    /* Makes the border transparent to create padding effect */
}

::-webkit-scrollbar-thumb:hover {
    background-color: #606060;
}

/* Firefox Support */
* {
    scrollbar-color: #909090 transparent;
}

/* Force social icons to be visible on all screen sizes */
#page-header #site_social_icons {
    display: block !important;
}

/* Keep the top navbar transparent so it embeds into the page background.
   Butterfly paints a white background on .not-top-img (list pages) and
   .nav-fixed (scrolled article pages); strip both along with the shadow. */
#page-header.not-top-img #nav,
#page-header.nav-fixed #nav {
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
}

/* Only show the top nav at page top. Butterfly re-shows the fixed nav on
   scroll-up via .nav-visible; cancel that translate so it stays hidden
   whenever the page is scrolled past the top. */
#page-header.nav-fixed.nav-visible #nav {
    transform: none !important;
}
