:root {
    color-scheme: light dark;
    --bg-1: #f9f7fb;
    --fg-1: #171717;
    --fg-2: rgba(23, 23, 23, 0.48);
    --fg-3: rgba(23, 23, 23, 0.34);
    --card-bg: #ffffff;
    --line: rgba(23, 23, 23, 0.28);
    --shadow: 0 6px 20px rgba(23, 23, 23, 0.01);
    --theme-selection: #47b2ff;
    --content-width: 640px;
    --layout-width: min(clamp(560px, 58vw, 720px), calc(100vw - 32px));
    --font-ui: "Inter", "PingFang SC", "Noto Sans SC", sans-serif;
    --font-body: "PingFang SC", "Noto Sans SC", "Helvetica Neue", sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-1: #131313;
        --fg-1: #f1eef4;
        --fg-2: rgba(241, 238, 244, 0.56);
        --fg-3: rgba(241, 238, 244, 0.34);
        --card-bg: #1a1a1d;
        --line: rgba(241, 238, 244, 0.18);
        --shadow: none;
    }
}

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

html {
    scroll-behavior: smooth;
}

::-moz-selection {
    background: var(--theme-selection);
    color: #ffffff;
}

::selection {
    background: var(--theme-selection);
    color: #ffffff;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--bg-1);
    color: var(--fg-1);
    font-family: var(--font-ui);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

img {
    display: block;
    max-width: 100%;
}

.shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    min-height: 72px;
}

.site-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        var(--bg-1) 0%,
        color-mix(in srgb, var(--bg-1) 70%, transparent) 58%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity 180ms ease;
    pointer-events: none;
}

.site-header.is-scrolled::before {
    opacity: 1;
}

.site-header__inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 72px;
}

.brand {
    position: absolute;
    left: 16px;
    top: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    overflow: hidden;
    transform: translateY(-50%);
}

.brand__image {
    width: 40px;
    height: 40px;
    object-fit: cover;
}

.desktop-nav {
    display: inline-flex;
    align-items: center;
    gap: 24px;
    justify-content: flex-start;
    width: var(--layout-width);
    min-height: 72px;
}

.nav-link {
    padding-bottom: 3px;
    border-bottom: 1px solid transparent;
    color: var(--fg-2);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.2;
    transition: color 180ms ease, border-color 180ms ease;
}

.nav-link:hover,
.nav-link.is-active {
    color: var(--fg-1);
    border-bottom-color: currentColor;
}

.page-main {
    flex: 1 0 auto;
    width: var(--layout-width);
    margin: 0 auto;
}

.title-block {
    padding-top: 18px;
    margin-bottom: 40px;
}

.page-title {
    margin: 0;
    font-family: var(--font-ui);
    font-size: 30px;
    font-weight: 300;
    letter-spacing: -0.04em;
    line-height: 1.02;
}

.inline-tabs {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    margin-bottom: 0;
}

.inline-tab {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--fg-2);
    font-size: 13px;
    line-height: 1.6;
    text-decoration: none;
    text-underline-offset: 3px;
}

.inline-tab.is-active {
    color: var(--fg-1);
    text-decoration: underline;
}

.content-copy {
    margin-top: 0;
}

.content-copy--stack {
    display: grid;
    gap: 12px;
}

.body-text {
    margin: 0;
    color: var(--fg-1);
    font-family: var(--font-body);
    font-size: 13px;
    line-height: 1.6;
}

.section-block {
    margin-top: 26px;
}

.section-heading {
    margin: 0 0 8px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.6;
}

.emoji-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.emoji-list__item {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 7px 0;
    border-bottom: 0.5px solid color-mix(in srgb, var(--line) 44%, transparent);
}

.emoji-list__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 21px;
    font-size: 11px;
    line-height: 1;
}

.emoji-list__body {
    margin: 0;
    color: var(--fg-1);
    font-family: var(--font-body);
    font-size: 13px;
    line-height: 1.6;
}

.emoji-list__title {
    font-weight: 600;
}

.emoji-list__separator,
.emoji-list__text {
    color: var(--fg-1);
}

.emoji-list__text--strong {
    font-weight: 600;
}

.social-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.social-card {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 11px 12px;
    border-radius: 8px;
    background: var(--card-bg);
    box-shadow: var(--shadow);
    font-size: 13px;
    line-height: 1.2;
    transition: transform 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.social-card svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.social-card.is-disabled {
    cursor: default;
}

.social-card:not(.is-disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(23, 23, 23, 0.08);
}

.social-card:not(.is-disabled):hover span {
    text-decoration: none;
}

.list-stack {
    display: grid;
    gap: 24px;
    margin-top: 18px;
}

.blog-year,
.project-year {
    margin: 42px 0 10px;
    color: var(--fg-2);
    font-size: 28px;
    font-weight: 300;
    letter-spacing: -0.04em;
    line-height: 1;
}

.blog-item {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    transition: color 180ms ease;
}

.blog-filter-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-top: 12px;
}

.blog-filter {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0 0 2px;
    border: 0;
    border-bottom: 1px solid transparent;
    background: transparent;
    color: var(--fg-2);
    font-size: 13px;
    line-height: 1.4;
    transition: color 180ms ease, border-color 180ms ease;
}

.blog-filter__count {
    color: var(--fg-3);
    font-size: 12px;
}

.blog-filter:hover,
.blog-filter.is-active {
    color: var(--fg-1);
    border-bottom-color: currentColor;
}

.blog-filter:hover .blog-filter__count,
.blog-filter.is-active .blog-filter__count {
    color: inherit;
}

.blog-item__title {
    display: block;
    max-width: 100%;
    margin-bottom: 4px;
    color: var(--fg-1);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.35;
    text-decoration: none;
    text-underline-offset: 2px;
}

.blog-item__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
}

.blog-item__summary {
    flex: 1 1 auto;
    display: block;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    overflow: hidden;
    color: var(--fg-2);
    font-family: var(--font-body);
    font-size: 12px;
    line-height: 1.45;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.blog-item__date {
    flex-shrink: 0;
    color: var(--fg-3);
    font-size: 12px;
    line-height: 1.45;
}

.blog-item__divider {
    flex-shrink: 0;
    color: var(--fg-3);
    font-size: 12px;
    line-height: 1.45;
}

.blog-item:hover .blog-item__title {
    text-decoration: underline;
}

.project-filter-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    margin-bottom: 0;
}

.project-filter {
    padding: 0 0 2px;
    border: 0;
    border-bottom: 1px solid transparent;
    background: transparent;
    color: var(--fg-2);
    font-size: 13px;
    line-height: 1.4;
    transition: color 180ms ease, border-color 180ms ease;
}

.project-filter:hover,
.project-filter.is-active {
    color: var(--fg-1);
    border-bottom-color: currentColor;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    margin-top: 14px;
}

.project-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px;
    border-radius: 12px;
    background: var(--card-bg);
    box-shadow: var(--shadow);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.project-card__icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    object-fit: cover;
}

.project-card__body {
    min-width: 0;
}

.project-card__title {
    margin: 0;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.project-card__summary {
    display: -webkit-box;
    margin: 1px 0 0;
    overflow: hidden;
    color: var(--fg-2);
    font-family: var(--font-body);
    font-size: 11px;
    line-height: 1.35;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.project-card__period {
    margin-top: 7px;
    color: var(--fg-2);
    font-size: 11px;
    line-height: 1.2;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(23, 23, 23, 0.08);
}

.article-page__hero {
    padding-top: 20px;
    margin-bottom: 40px;
}

.article-page {
    opacity: 0;
}

.article-page.is-visible {
    opacity: 1;
}

.article-page__hero,
.article-body {
    opacity: 0;
    transform: translateY(10px);
}

.article-page.is-visible .article-page__hero {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 280ms ease, transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.article-page.is-visible .article-body {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 320ms ease 40ms, transform 480ms cubic-bezier(0.22, 1, 0.36, 1) 40ms;
}

.article-page__title {
    font-size: 36px;
    font-weight: 400;
    line-height: 1.06;
}

.article-meta {
    margin: 12px 0 0;
    color: var(--fg-2);
    font-size: 13px;
    line-height: 1.5;
}

.article-body {
    margin-top: 0;
    color: var(--fg-1);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.9;
}

.article-body > * {
    width: 100%;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.article-body > * + * {
    margin-top: 20px;
}

.article-body h2 {
    margin-top: 56px;
    margin-bottom: 0;
    font-family: var(--font-ui);
    font-size: 28px;
    font-weight: 500;
    line-height: 1.2;
}

.article-body h3 {
    margin-top: 36px;
    margin-bottom: 0;
    font-family: var(--font-ui);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.35;
}

.article-body img,
.article-body video {
    width: auto;
    border-radius: 16px;
    box-shadow: none;
}

.article-body a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.article-body blockquote {
    padding: 16px 18px;
    border-left: 2px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--card-bg) 92%, var(--bg-1));
}

.article-body ul,
.article-body ol {
    padding-left: 22px;
}

.article-body li + li {
    margin-top: 8px;
}

.article-loading .page-main {
    min-height: calc(100vh - 72px - 112px);
}

.article-loading-view {
    display: block;
}

.article-skeleton__hero {
    display: grid;
    gap: 14px;
}

.article-skeleton__body {
    display: grid;
    gap: 14px;
}

.article-skeleton__title,
.article-skeleton__meta,
.article-skeleton__line {
    display: block;
    border-radius: 999px;
    background:
        linear-gradient(
            90deg,
            color-mix(in srgb, var(--fg-1) 6%, transparent) 0%,
            color-mix(in srgb, var(--card-bg) 88%, var(--fg-1) 8%) 48%,
            color-mix(in srgb, var(--fg-1) 6%, transparent) 100%
        );
    background-size: 220% 100%;
    animation: article-skeleton-shimmer 1.6s linear infinite;
}

.article-skeleton__title {
    width: min(78%, 480px);
    height: 42px;
}

.article-skeleton__meta {
    width: min(36%, 220px);
    height: 14px;
}

.article-skeleton__line {
    width: 100%;
    max-width: 720px;
    height: 14px;
}

.article-skeleton__line--wide {
    width: 96%;
}

.article-skeleton__line--medium {
    width: 82%;
}

.article-skeleton__line--short {
    width: 62%;
}

@keyframes article-skeleton-shimmer {
    0% {
        background-position: 100% 50%;
    }

    100% {
        background-position: -100% 50%;
    }
}

.empty-state {
    margin-top: 22px;
    color: var(--fg-2);
    font-size: 13px;
    line-height: 1.6;
}

.site-footer {
    display: block;
    height: auto;
    max-width: none;
    width: var(--layout-width);
    margin: 40px auto 0;
    padding: 24px 0 32px;
    border-top: 0.5px solid var(--line);
}

.site-footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    color: var(--fg-1);
    font-size: 11px;
    line-height: 1.4;
}

.site-footer__links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.page-main > .title-block + .section-block {
    margin-top: 0;
}

.page-main > .title-block + .section-block .list-stack,
.page-main > .title-block + .section-block .project-grid {
    margin-top: 0;
}

.mobile-nav {
    display: none;
}

@media (max-width: 767px) {
    .site-header {
        min-height: 68px;
    }

    .site-header__inner {
        width: calc(100vw - 32px);
        min-height: 68px;
    }

    .desktop-nav {
        display: none;
    }

    .page-main,
    .site-footer {
        width: calc(100vw - 32px);
    }

    .page-title {
        font-size: 42px;
    }

    .content-copy {
        margin-top: 0;
    }

    .social-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .blog-year,
    .project-year {
        margin-top: 44px;
        font-size: 28px;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    .blog-item__title {
        font-size: 16px;
    }

    .blog-filter-row {
        gap: 8px 12px;
    }

    .project-filter {
        font-size: 11px;
    }

    .article-page__hero {
        padding-top: 16px;
    }

    .article-page__title {
        font-size: 36px;
    }

    .article-skeleton__hero {
        gap: 12px;
    }

    .article-skeleton__title {
        width: 92%;
        height: 38px;
    }

    .article-skeleton__meta {
        width: 46%;
    }

    .article-body {
        font-size: 15px;
        line-height: 1.8;
    }

    .article-body h2 {
        margin-top: 40px;
        font-size: 24px;
    }

    .article-body h3 {
        font-size: 18px;
    }

    .site-footer {
        padding-bottom: 136px;
        border-top-color: color-mix(in srgb, var(--line) 50%, transparent);
    }

    .site-footer__inner {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px;
        color: var(--fg-3);
        text-align: center;
    }

    .site-footer__links {
        justify-content: center;
        gap: 20px;
        flex-wrap: wrap;
        color: var(--fg-3);
    }

    .mobile-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 20;
        display: flex;
        justify-content: center;
        padding: 30px 16px calc(env(safe-area-inset-bottom, 0px) + 18px);
        pointer-events: none;
    }

    .mobile-nav::before {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: 104px;
        background: linear-gradient(
            to top,
            var(--bg-1) 0%,
            color-mix(in srgb, var(--bg-1) 70%, transparent) 48%,
            transparent 100%
        );
        pointer-events: none;
    }

    .mobile-nav__rail {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 22px;
        padding: 11px 24px;
        border-radius: 999px;
        background: color-mix(in srgb, var(--card-bg) 94%, transparent);
        box-shadow: 0 10px 24px rgba(23, 23, 23, 0.035);
        backdrop-filter: blur(12px);
        pointer-events: auto;
    }

    .mobile-nav__link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 40px;
        padding: 0;
        color: var(--fg-3);
        font-size: 13px;
        line-height: 1;
    }

    .mobile-nav__link.is-active {
        color: var(--fg-1);
    }
}
