@font-face {
    font-family: 'Space Grotesk';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('../fonts/SpaceGrotesk-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

.pf-page {
    --pf-display: 'Space Grotesk', 'Inter', 'Microsoft YaHei', sans-serif;
    --pf-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    width: 100%;
    padding: var(--space-6) 0 var(--space-10);
}

.pf-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.8fr);
    align-items: center;
    gap: clamp(28px, 5vw, 64px);
    min-height: 400px;
    padding: var(--space-8) clamp(24px, 4vw, 48px);
    overflow: hidden;
    background: linear-gradient(115deg, rgba(124, 140, 255, 0.11), transparent 52%), var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
}

.pf-hero::after {
    content: '{ }';
    position: absolute;
    right: -14px;
    bottom: -70px;
    color: rgba(255, 255, 255, 0.022);
    font: 700 clamp(180px, 24vw, 320px)/1 var(--pf-display);
    pointer-events: none;
}

.pf-hero-copy,
.pf-workbench { position: relative; z-index: 1; }

.pf-eyebrow {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--text-muted);
    font: 600 11px/1.4 var(--pf-mono);
    letter-spacing: 0.12em;
}

.pf-eyebrow > span {
    width: 7px;
    height: 7px;
    background: var(--cyan);
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(79, 216, 232, 0.6);
}

.pf-hero h1 {
    margin: 22px 0 18px;
    font-family: var(--pf-display);
    font-size: clamp(38px, 5.2vw, 68px);
    font-weight: 700;
    line-height: 1.13;
    letter-spacing: -0.055em;
}

.pf-hero h1 em {
    color: var(--primary);
    font-style: normal;
}

.pf-intro {
    max-width: 540px;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.85;
}

.pf-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.pf-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 42px;
    padding: 9px 17px;
    color: var(--text-secondary);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    transition: color var(--transition), background var(--transition), border-color var(--transition), transform var(--transition);
}

.pf-button:hover {
    color: var(--text);
    background: var(--surface-hover);
    border-color: rgba(124, 140, 255, 0.45);
    transform: translateY(-2px);
}

.pf-button-primary {
    color: #fff;
    background: var(--gradient-primary);
    border-color: transparent;
}

.pf-button-primary:hover { color: #fff; background: var(--gradient-primary); }

.pf-workbench {
    overflow: hidden;
    background: rgba(7, 8, 12, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transform: rotate(1.5deg);
}

.pf-workbench-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 11px 13px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid var(--border-light);
}

.pf-workbench-bar > span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-muted);
    opacity: 0.65;
}

.pf-workbench-bar > span:first-child { background: var(--danger); }
.pf-workbench-bar > span:nth-child(2) { background: var(--warning); }
.pf-workbench-bar > span:nth-child(3) { background: var(--success); }

.pf-workbench-bar small {
    margin-left: auto;
    color: var(--text-muted);
    font: 10px var(--pf-mono);
}

.pf-workbench-body { padding: 22px 14px; }

.pf-workbench-body p {
    display: flex;
    align-items: center;
    min-height: 26px;
    color: var(--text-secondary);
    font: 11px/1.7 var(--pf-mono);
    white-space: nowrap;
}

.pf-line-no {
    width: 28px;
    flex-shrink: 0;
    color: var(--text-muted);
    opacity: 0.5;
    user-select: none;
}

.pf-code-key { color: var(--accent); }
.pf-code-string { color: var(--cyan); }
.pf-code-fn { color: var(--primary); }

.pf-cursor {
    width: 6px;
    height: 14px;
    margin-left: 5px;
    background: var(--primary);
    animation: pf-blink 1.1s steps(1) infinite;
}

.pf-workbench-foot {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 14px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-light);
    font: 10px var(--pf-mono);
}

.pf-status-dot {
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
}

.pf-section { margin-top: var(--space-12); scroll-margin-top: var(--space-5); }

.pf-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: var(--space-5);
    margin-bottom: var(--space-5);
}

.pf-section-heading h2,
.pf-contact h2 {
    margin-top: 9px;
    font: 700 clamp(24px, 3vw, 34px)/1.25 var(--pf-display);
    letter-spacing: -0.04em;
}

.pf-section-heading > p {
    max-width: 320px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.7;
    text-align: right;
}

.pf-featured-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
}

.pf-project {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 278px;
    padding: 25px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.pf-project::before {
    content: '';
    position: absolute;
    top: 0;
    left: 25px;
    width: 40px;
    height: 2px;
    background: var(--primary);
    transition: width var(--transition);
}

.pf-project:hover {
    background: var(--surface-hover);
    border-color: rgba(124, 140, 255, 0.35);
    transform: translateY(-3px);
}

.pf-project:hover::before { width: 80px; }

.pf-project-wide {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: var(--space-6);
    min-height: 244px;
    background: linear-gradient(105deg, rgba(124, 140, 255, 0.1), transparent 62%), var(--surface);
}

.pf-project-top {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.pf-project-kind {
    color: var(--text-muted);
    font: 600 10px var(--pf-mono);
    letter-spacing: 0.1em;
}

.pf-language {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font: 10px var(--pf-mono);
    white-space: nowrap;
}

.pf-language i,
.pf-repo-language i {
    width: 7px;
    height: 7px;
    flex-shrink: 0;
    background: var(--primary);
    border-radius: 50%;
}

.pf-language[data-language-color] i { background: #3776ab; }

.pf-project h3 { margin: 24px 0 11px; }

.pf-project h3 a {
    color: var(--text);
    font: 650 20px/1.35 var(--pf-display);
    letter-spacing: -0.025em;
}

.pf-project h3 a span { color: var(--text-muted); font-size: 15px; }
.pf-project h3 a:hover { color: var(--primary); }
.pf-project h3 a:hover span { color: var(--primary); }

.pf-project p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.8;
}

.pf-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: auto;
    padding-top: 20px;
}

.pf-tags span {
    padding: 3px 8px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font: 10px var(--pf-mono);
}

.pf-source-link {
    align-self: end;
    padding: 8px 0 3px;
    color: var(--primary);
    font-size: 12px;
    white-space: nowrap;
}

.pf-filter-panel {
    padding: var(--space-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.pf-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 13px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.pf-search:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.pf-search svg { width: 17px; height: 17px; flex-shrink: 0; color: var(--text-muted); }

.pf-search input {
    width: 100%;
    min-width: 0;
    height: 44px;
    color: var(--text);
    background: transparent;
    border: 0;
    outline: none;
    font: inherit;
    font-size: 13px;
}

.pf-search input::placeholder { color: var(--text-muted); }
.pf-search kbd { padding: 2px 7px; color: var(--text-muted); background: var(--surface); border: 1px solid var(--border); border-radius: 4px; font: 11px var(--pf-mono); }

.pf-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 13px;
}

.pf-platform-tabs {
    display: flex;
    gap: 3px;
    margin-right: auto;
    padding: 3px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
}

.pf-platform-tabs button {
    padding: 7px 13px;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.pf-platform-tabs button:hover { color: var(--text); }
.pf-platform-tabs button.is-active { color: var(--text); background: var(--surface-hover); box-shadow: var(--shadow-sm); }

.pf-select-label select {
    height: 37px;
    max-width: 155px;
    padding: 0 30px 0 11px;
    color: var(--text-secondary);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.pf-index-meta {
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
    padding: 15px 3px 11px;
    color: var(--text-muted);
    font: 10px var(--pf-mono);
}

.pf-index-meta p { min-width: 0; }
#portfolioUpdated { text-align: right; }

.pf-repo-list { border-top: 1px solid var(--border); }

.pf-repo {
    display: grid;
    grid-template-columns: minmax(150px, 0.7fr) minmax(0, 1.65fr) auto;
    align-items: center;
    gap: var(--space-5);
    min-height: 100px;
    padding: 18px 4px;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition), padding var(--transition);
}

.pf-repo:hover { padding-right: 12px; padding-left: 12px; background: var(--surface); }

.pf-repo-name {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    color: var(--text);
    font: 600 15px var(--pf-display);
}

.pf-repo-name svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-muted); }
.pf-repo-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-repo-name:hover { color: var(--primary); }
.pf-repo-name:hover span { text-decoration: underline; text-underline-offset: 4px; }

.pf-repo-description {
    display: -webkit-box;
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.7;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.pf-repo-description.is-empty { color: var(--text-muted); font-style: italic; }

.pf-repo-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 13px;
    color: var(--text-muted);
    font: 10px var(--pf-mono);
    white-space: nowrap;
}

.pf-repo-language { display: inline-flex; align-items: center; gap: 5px; }
.pf-repo-platform { padding: 3px 6px; border: 1px solid var(--border-light); border-radius: 4px; }
.pf-repo-stars { color: var(--warning); }
.pf-repo-date { color: var(--text-muted); }

.pf-loading { display: grid; gap: 10px; padding: 10px 0; }
.pf-loading span { height: 76px; background: linear-gradient(90deg, var(--surface), var(--surface-hover), var(--surface)); background-size: 200% 100%; border-radius: var(--radius); animation: pf-shimmer 1.5s infinite; }

.pf-empty {
    padding: var(--space-10) var(--space-5);
    text-align: center;
    border-bottom: 1px solid var(--border-light);
}

.pf-empty strong { font-size: 16px; }
.pf-empty p { margin: 8px 0 20px; color: var(--text-muted); font-size: 13px; }
.pf-empty button { padding: 8px 15px; color: var(--primary); background: var(--primary-light); border: 1px solid rgba(124, 140, 255, 0.25); border-radius: var(--radius); cursor: pointer; }

.pf-load-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    margin-top: var(--space-5);
    padding: 13px;
    color: var(--text-secondary);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.pf-load-more:hover { color: var(--primary); border-color: rgba(124, 140, 255, 0.4); }
.pf-noscript { padding: var(--space-4); color: var(--warning); background: var(--warning-light); border-radius: var(--radius); }

.pf-contact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-6);
    margin-top: var(--space-16);
    padding: clamp(25px, 4vw, 42px);
    background: var(--gradient-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
}

.pf-contact h2 { font-size: clamp(23px, 3vw, 32px); }
.pf-contact p:last-child { margin-top: 10px; color: var(--text-secondary); font-size: 13px; }
.pf-contact .pf-button { flex-shrink: 0; }
.pf-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

@keyframes pf-blink { 50% { opacity: 0; } }
@keyframes pf-shimmer { to { background-position: -200% 0; } }

@media (max-width: 1100px) {
    .pf-hero { grid-template-columns: 1fr; }
    .pf-workbench { max-width: 480px; transform: none; }
    .pf-repo { grid-template-columns: minmax(150px, 0.65fr) minmax(0, 1.4fr); gap: 16px 24px; }
    .pf-repo-meta { grid-column: 2; justify-content: flex-start; }
}

@media (max-width: 768px) {
    .pf-page { padding-top: var(--space-4); }
    .pf-hero { min-height: 0; padding: 30px 22px; }
    .pf-hero h1 { font-size: clamp(34px, 8vw, 52px); }
    .pf-intro { font-size: 14px; }
    .pf-workbench { display: none; }
    .pf-section { margin-top: var(--space-10); }
    .pf-section-heading { align-items: start; flex-direction: column; gap: 10px; }
    .pf-section-heading > p { text-align: left; }
    .pf-featured-grid { grid-template-columns: 1fr; }
    .pf-project-wide { grid-column: auto; display: flex; }
    .pf-project { min-height: 0; padding: 22px; }
    .pf-project p { font-size: 13px; }
    .pf-source-link { align-self: start; margin-top: 18px; }
    .pf-filters { flex-wrap: wrap; }
    .pf-platform-tabs { width: 100%; margin-right: 0; }
    .pf-platform-tabs button { flex: 1; }
    .pf-select-label { flex: 1; }
    .pf-select-label select { width: 100%; max-width: none; }
    .pf-repo { grid-template-columns: 1fr; gap: 9px; padding: 20px 4px; }
    .pf-repo:hover { padding-right: 4px; padding-left: 4px; }
    .pf-repo-meta { grid-column: auto; flex-wrap: wrap; justify-content: flex-start; }
    .pf-index-meta { flex-direction: column; gap: 4px; }
    #portfolioUpdated { text-align: left; }
    .pf-contact { align-items: start; flex-direction: column; margin-top: var(--space-12); }
}

@media (max-width: 480px) {
    .pf-hero-actions .pf-button { flex: 1; padding-right: 10px; padding-left: 10px; }
    .pf-project-top { align-items: start; flex-direction: column; gap: 8px; }
    .pf-search kbd { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .pf-cursor, .pf-loading span { animation: none; }
    .pf-project, .pf-button, .pf-repo { transition: none; }
    .pf-project:hover, .pf-button:hover { transform: none; }
}
