:root {
    color-scheme: light;
    --bg: #fbfaf7;
    --surface: #ffffff;
    --surface-soft: #f3f1eb;
    --text: #171512;
    --muted: #68635b;
    --subtle: #9a9488;
    --line: #e4dfd5;
    --line-strong: #cec7b9;
    --accent: #2f6fed;
    --accent-dark: #174ea6;
    --green: #16845f;
    --warm: #b76e2b;
    --green-soft: #e5f4ec;
    --ink: #050505;
    --shadow: 0 24px 80px rgba(18, 22, 28, 0.12);
    --radius: 18px;
    --radius-sm: 10px;
    --max: 1180px;
    --nav-height: 72px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        linear-gradient(rgba(23, 21, 18, 0.026) 1px, transparent 1px),
        linear-gradient(90deg, rgba(23, 21, 18, 0.026) 1px, transparent 1px),
        radial-gradient(circle at 14% 12%, rgba(47, 111, 237, 0.08), transparent 28rem),
        radial-gradient(circle at 92% 10%, rgba(183, 110, 43, 0.1), transparent 22rem),
        var(--bg);
    background-size: 34px 34px, 34px 34px, auto, auto, auto;
    color: var(--text);
    font-family: "HarmonyOS Sans SC", "MiSans", "Alibaba PuHuiTi", "PingFang SC", "Microsoft YaHei", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(251, 250, 247, 0.2), rgba(251, 250, 247, 0.88) 48%, rgba(251, 250, 247, 1));
    z-index: -1;
}

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

a:focus-visible,
button:focus-visible {
    outline: 3px solid rgba(31, 111, 235, 0.55);
    outline-offset: 4px;
}

.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 100;
    padding: 10px 14px;
    border-radius: 999px;
    background: var(--ink);
    color: white;
    transform: translateY(-160%);
    transition: transform 0.18s ease;
}

.skip-link:focus {
    transform: translateY(0);
}

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 90;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #22c55e, #38bdf8, var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.08s linear;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    height: var(--nav-height);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 24px;
    backdrop-filter: blur(18px);
}

.brand,
.site-nav,
.nav-action {
    display: inline-flex;
    align-items: center;
}

.brand {
    gap: 12px;
    justify-self: start;
    font-weight: 720;
}

.brand-mark {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid var(--ink);
    border-radius: 9px;
    background: var(--ink);
    color: white;
    font-size: 0.8rem;
    letter-spacing: 0;
}

.brand-text {
    letter-spacing: -0.01em;
}

.site-nav {
    gap: 6px;
    justify-self: center;
    padding: 6px;
    border: 1px solid rgba(17, 17, 17, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 8px 30px rgba(17, 17, 17, 0.06);
}

.site-nav a {
    padding: 8px 14px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 620;
}

.site-nav a:hover {
    background: var(--ink);
    color: white;
}

.site-nav a.is-active {
    background: var(--ink);
    color: white;
}

.nav-action {
    justify-self: end;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
    font-size: 0.92rem;
    font-weight: 680;
}

main {
    max-width: var(--max);
    margin: 0 auto;
    padding: 32px 24px 80px;
}

.system-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    margin: 0 0 10px;
    padding: 7px;
    border: 1px solid rgba(23, 21, 18, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.62);
    color: var(--muted);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.76rem;
}

.system-strip span {
    padding: 5px 9px;
    border-radius: 999px;
}

.system-strip span:first-child {
    background: rgba(34, 197, 94, 0.12);
    color: #166534;
}

.system-strip strong {
    color: var(--text);
    font-weight: 760;
}

.hero-section {
    min-height: calc(100dvh - var(--nav-height) - 32px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.78fr);
    gap: 38px;
    align-items: center;
    padding: 34px 0 64px;
}

.eyebrow {
    margin: 0 0 14px;
    color: var(--accent);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.78rem;
    font-weight: 720;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-copy h1,
.section-heading h2,
.contact-band h2 {
    margin: 0;
    font-weight: 760;
    letter-spacing: 0;
    line-height: 1.03;
}

.hero-copy h1 {
    max-width: 760px;
    font-size: clamp(2.6rem, 5.4vw, 4.6rem);
}

.hero-lede {
    max-width: 670px;
    margin: 26px 0 0;
    color: #555047;
    font-size: clamp(1.08rem, 2vw, 1.32rem);
}

.hero-actions,
.contact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.code-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.code-strip span {
    padding: 6px 10px;
    border: 1px solid rgba(23, 21, 18, 0.09);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--muted);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.78rem;
}

.code-strip span::before {
    content: "#";
    color: var(--accent);
    margin-right: 2px;
}

.button {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border-radius: 999px;
    font-weight: 720;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button.primary {
    background: linear-gradient(135deg, var(--ink), #2d2a25);
    color: white;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

.button.secondary {
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.78);
}

.button.ghost {
    border: 1px dashed rgba(23, 21, 18, 0.24);
    background: transparent;
    color: var(--muted);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    max-width: 680px;
    margin: 36px 0 0;
}

.metric-grid div {
    padding: 16px;
    border: 1px solid rgba(17, 17, 17, 0.08);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.76);
}

.metric-grid dt {
    color: var(--muted);
    font-size: 0.85rem;
}

.metric-grid dd {
    margin: 4px 0 0;
    font-size: 2rem;
    font-weight: 780;
    letter-spacing: -0.04em;
}

.hero-panel {
    position: relative;
    overflow: hidden;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 22px 70px rgba(26, 24, 20, 0.1);
}

.hero-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, transparent 0 48%, rgba(47, 111, 237, 0.08) 48% 49%, transparent 49%),
        linear-gradient(180deg, transparent 0 68%, rgba(34, 197, 94, 0.08) 68% 69%, transparent 69%);
    opacity: 0.42;
}

.hero-panel > * {
    position: relative;
    z-index: 1;
}

.board-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 10px 10px 18px;
}

.board-header h2 {
    margin: 0;
    font-size: 1.6rem;
    letter-spacing: -0.04em;
}

.board-header .eyebrow {
    margin-bottom: 6px;
}

.board-header a,
.micro-command {
    flex: 0 0 auto;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fffdf8;
    color: var(--accent-dark);
    font-size: 0.86rem;
    font-weight: 740;
}

.micro-command {
    cursor: pointer;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.micro-command:hover {
    border-color: var(--accent);
}

.micro-command.is-running {
    border-color: rgba(34, 197, 94, 0.55);
    background: rgba(34, 197, 94, 0.12);
    color: #166534;
}

.repo-rank {
    display: grid;
    gap: 10px;
}

.rank-card {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    column-gap: 14px;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fffdf8;
}

.rank-card.primary-rank {
    background:
        radial-gradient(circle at 96% 0%, rgba(31, 111, 235, 0.12), transparent 12rem),
        var(--surface);
    border-color: rgba(31, 111, 235, 0.28);
}

.rank-number {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--ink);
    color: white;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.76rem;
    font-weight: 760;
}

.rank-card h3,
.rank-card p {
    margin: 0;
}

.rank-card h3 {
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.rank-card p {
    color: var(--muted);
    font-size: 0.86rem;
}

.rank-card strong {
    color: var(--accent-dark);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.9rem;
}

.rank-card h3::after {
    content: "_";
    color: #22c55e;
    margin-left: 3px;
}

.repo-overview {
    display: grid;
    grid-template-columns: 0.78fr 1.22fr;
    gap: 18px;
    align-items: stretch;
    padding-top: 30px;
}

.repo-overview-card {
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background:
        radial-gradient(circle at 100% 0%, rgba(47, 111, 237, 0.12), transparent 14rem),
        #fffdf8;
    color: var(--text);
}

.repo-overview-card .eyebrow {
    color: var(--accent);
}

.repo-overview-card h2 {
    margin: 0;
    max-width: 430px;
    font-size: clamp(2rem, 4vw, 3.2rem);
    letter-spacing: -0.035em;
    line-height: 1.04;
}

.repo-overview-card p:not(.eyebrow) {
    margin: 16px 0 0;
    color: var(--muted);
}

.repo-chip-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.repo-chip-grid a {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 112px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.repo-chip-grid a:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
}

.repo-chip-grid a:nth-child(1),
.repo-chip-grid a:nth-child(2) {
    background:
        linear-gradient(135deg, rgba(47, 111, 237, 0.06), rgba(255, 255, 255, 0.84)),
        #fffdf8;
}

.repo-chip-grid strong {
    letter-spacing: -0.02em;
}

.repo-chip-grid span {
    color: var(--muted);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.82rem;
}

.announcement-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 0.92rem;
}

.command-output {
    position: relative;
    display: grid;
    gap: 5px;
    margin-top: 10px;
    padding: 13px 14px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.18);
    border-radius: 14px;
    background: #0f172a;
    color: #dbeafe;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.82rem;
}

.command-output::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.2), transparent);
    transform: translateX(-120%);
}

.command-output.is-active::after {
    animation: terminalScan 0.75s ease;
}

.command-text {
    color: #e2e8f0;
    font-weight: 700;
}

.command-line {
    display: block;
}

.command-line.dim {
    color: #94a3b8;
}

@keyframes terminalScan {
    from { transform: translateX(-120%); }
    to { transform: translateX(120%); }
}

.status-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--green);
    box-shadow: 0 0 0 6px rgba(15, 138, 95, 0.12);
}

.section-shell {
    padding: 68px 0;
    border-top: 1px solid var(--line);
}

.section-heading {
    max-width: 760px;
    margin: 0 auto 30px;
    text-align: center;
}

.section-heading.align-left {
    margin: 0;
    text-align: left;
}

.section-heading h2,
.contact-band h2 {
    font-size: clamp(2.25rem, 5vw, 3.8rem);
}

.section-heading p:not(.eyebrow) {
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 1.05rem;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.project-card,
.project-row,
.focus-grid article {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.78);
}

.project-card {
    min-height: 292px;
    display: flex;
    flex-direction: column;
    padding: 28px;
    border-radius: 26px;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.project-card[data-project-card]:hover {
    transform: translateY(-4px);
    border-color: var(--line-strong);
    box-shadow: 0 20px 52px rgba(26, 24, 20, 0.1);
}

.project-card-large {
    background:
        radial-gradient(circle at 80% 0%, rgba(31, 111, 235, 0.12), transparent 18rem),
        #fffdf8;
}

.project-card.accent-green {
    background:
        radial-gradient(circle at 80% 0%, rgba(15, 138, 95, 0.14), transparent 18rem),
        #fffdf8;
}

.project-meta {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: var(--muted);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.8rem;
}

.project-meta strong {
    color: var(--ink);
}

.project-card h3 {
    margin: auto 0 12px;
    font-size: clamp(2rem, 4vw, 3.1rem);
    letter-spacing: -0.035em;
    line-height: 1.04;
}

.project-card p {
    margin: 0;
    color: var(--muted);
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.tag-row span {
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.78rem;
}

.project-card a {
    width: fit-content;
    margin-top: 24px;
    color: var(--accent-dark);
    font-weight: 740;
}

.project-list {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.project-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border-radius: 18px;
}

.project-row h3,
.project-row p {
    margin: 0;
}

.project-row h3 {
    font-size: 1.18rem;
    letter-spacing: -0.02em;
}

.project-row p:not(.row-kicker) {
    color: var(--muted);
}

.row-kicker {
    margin-bottom: 5px;
    color: var(--accent);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.76rem;
    font-weight: 720;
    text-transform: uppercase;
}

.project-row a {
    min-width: 84px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    text-align: center;
    font-weight: 700;
}

.muted-row {
    background: rgba(243, 241, 235, 0.74);
}

.split-section {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 32px;
    align-items: start;
}

.focus-grid {
    display: grid;
    gap: 14px;
}

.focus-grid article {
    padding: 24px;
    border-radius: 22px;
}

.focus-index {
    color: var(--subtle);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-weight: 720;
}

.focus-grid h3 {
    margin: 26px 0 8px;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
}

.focus-grid p {
    margin: 0;
    color: var(--muted);
}

.contact-band {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 32px;
    align-items: end;
    margin-top: 22px;
    padding: 42px;
    border: 1px solid var(--ink);
    border-radius: 30px;
    background: linear-gradient(135deg, #171512, #2f2a23);
    color: white;
}

.contact-band .eyebrow {
    color: #8ab4ff;
}

.contact-band .button.secondary {
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.08);
}

.contact-band .button.primary {
    background: white;
    color: var(--ink);
}

.contact-actions {
    justify-content: flex-end;
}

.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.86);
    color: var(--text);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.site-footer {
    max-width: var(--max);
    margin: 0 auto;
    padding: 24px;
    color: var(--muted);
    font-size: 0.9rem;
}

@media (max-width: 900px) {
    .site-header {
        grid-template-columns: 1fr auto;
    }

    .site-nav {
        display: none;
    }

    .hero-section,
    .split-section,
    .contact-band {
        grid-template-columns: 1fr;
    }

    .hero-section {
        min-height: auto;
        padding-top: 28px;
    }

    .hero-panel {
        order: -1;
    }

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

    .repo-overview {
        grid-template-columns: 1fr;
    }

    .contact-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 560px) {
    .site-header,
    main,
    .site-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .brand-text {
        display: none;
    }

    .nav-action {
        min-height: 38px;
        padding: 0 13px;
    }

    .hero-copy h1 {
        font-size: 2.65rem;
    }

    .metric-grid,
    .project-row,
    .repo-chip-grid {
        grid-template-columns: 1fr;
    }

    .project-row a {
        width: fit-content;
    }

    .project-card,
    .contact-band {
        padding: 22px;
        border-radius: 22px;
    }

    .hero-actions,
    .contact-actions,
    .code-strip,
    .system-strip {
        flex-direction: column;
    }

    .button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

.loading-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: var(--bg);
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--line);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-screen p {
    color: var(--muted);
    font-size: 0.9rem;
}
