:root {
    --bg-color: #0a0a0f;
    --card-bg: rgba(12, 16, 26, 0.82);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-border-hover: rgba(255, 175, 50, 0.35);
    --text-color: rgba(255, 255, 255, 0.65);
    --text-muted: rgba(255, 255, 255, 0.45);
    --text-heading: #ffffff;
    --accent-amber: #ff8c00;
    --accent-gold: #ffbe3b;
    --link-color: rgba(255, 255, 255, 0.8);
    --link-hover-color: #ffffff;
    --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    --font-mono: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-ui);
    min-height: 100vh;
    width: 100vw;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Home page is fixed to viewport */
body.page-home {
    height: 100vh;
    overflow: hidden;
}

/* Canvas background stays fixed in viewport */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* ==========================================================================
   Home Page
   ========================================================================== */

.content-wrapper {
    position: relative;
    z-index: 10;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.logo {
    width: 100%;
    max-width: 240px;
    height: auto;
    display: block;
    filter: drop-shadow(0 0 28px rgba(226, 232, 240, 0.2)) drop-shadow(0 0 56px rgba(226, 232, 240, 0.08));
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.4s ease;
    user-select: none;
}

.logo:hover {
    transform: scale(1.03);
    filter: drop-shadow(0 0 35px rgba(255, 175, 50, 0.35)) drop-shadow(0 0 65px rgba(226, 232, 240, 0.15));
}

@media (max-width: 768px) {
    .logo {
        max-width: 190px;
    }
}

/* ==========================================================================
   Open Source Page
   ========================================================================== */

.page-open-source {
    overflow-y: auto;
}

.os-topbar {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.os-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    color: var(--text-heading);
    transition: opacity 0.2s ease;
}

.os-brand:hover {
    opacity: 0.85;
}

.os-brand-logo {
    width: 36px;
    height: 36px;
    display: block;
    filter: drop-shadow(0 0 12px rgba(226, 232, 240, 0.25));
}

.os-brand-name {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #ffffff;
}

.os-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.85rem;
    border-radius: 9999px;
    background: rgba(255, 140, 0, 0.08);
    border: 1px solid rgba(255, 140, 0, 0.25);
    color: var(--accent-gold);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: lowercase;
}

.os-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent-gold);
    box-shadow: 0 0 8px var(--accent-gold);
    animation: pulse 2.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.os-main {
    position: relative;
    z-index: 10;
    flex: 1;
    width: 100%;
}

.os-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

.os-intro {
    margin-bottom: 2.75rem;
}

.os-title {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #ffffff;
    margin-bottom: 0.75rem;
}

.os-description {
    font-size: 1.1rem;
    color: var(--text-color);
    max-width: 640px;
    line-height: 1.6;
}

/* Cards Grid */
.os-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-4px);
    border-color: var(--card-border-hover);
    box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.6), 0 0 24px rgba(255, 140, 0, 0.12);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.card-icon-wrap {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
}

.card-repo-slug {
    font-family: var(--font-mono);
    font-size: 0.825rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 0.85rem;
    letter-spacing: -0.02em;
}

.card-summary {
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 1.75rem;
}

.tag {
    font-size: 0.725rem;
    font-family: var(--font-mono);
    padding: 0.25rem 0.55rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.65);
    letter-spacing: 0.02em;
}

.card-btn {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.8rem 1.1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-heading);
    font-family: var(--font-mono);
    font-size: 0.825rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.card-btn:hover {
    background: rgba(255, 140, 0, 0.1);
    border-color: rgba(255, 140, 0, 0.35);
    color: #ffffff;
}

.icon-arrow {
    transition: transform 0.2s ease;
}

.card-btn:hover .icon-arrow,
.hf-banner:hover .icon-arrow {
    transform: translate(2px, -2px);
}

/* Hugging Face Banner */
.hf-section {
    margin-top: 1rem;
}

.hf-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.35rem 1.6rem;
    background: rgba(12, 16, 26, 0.6);
    border: 1px dashed rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.hf-banner:hover {
    border-color: rgba(255, 190, 60, 0.4);
    background: rgba(255, 190, 60, 0.04);
    transform: translateY(-2px);
}

.hf-left {
    display: flex;
    align-items: center;
    gap: 1.1rem;
}

.hf-emoji {
    font-size: 2rem;
    line-height: 1;
}

.hf-title {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
}

.hf-status-pill {
    font-size: 0.65rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
}

.hf-caption {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.hf-right {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.825rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.hf-banner:hover .hf-right {
    color: var(--accent-gold);
}

@media (max-width: 640px) {
    .hf-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .hf-right {
        align-self: flex-end;
    }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    position: relative;
    z-index: 10;
    width: 100%;
    padding: 2.5rem 1rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
}

/* Home page footer is positioned absolute at the bottom */
body.page-home .site-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    padding: 2rem 1rem;
}

.footer-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-link {
    color: var(--link-color);
    text-decoration: none;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: lowercase;
    transition: all 0.2s ease;
    padding: 0.25rem 0.65rem;
    border-radius: 4px;
    border: 1px solid transparent;
}

.footer-link:hover {
    color: var(--link-hover-color);
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.03);
}

.copyright {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.75rem;
    letter-spacing: 0.03em;
}

/* ==========================================================================
   404 Page
   ========================================================================== */

.not-found-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    z-index: 10;
    position: relative;
    text-align: center;
    padding: 2rem;
}

.not-found-logo {
    max-width: 120px;
    margin-bottom: 2rem;
    filter: drop-shadow(0 0 16px rgba(226, 232, 240, 0.15));
    transition: transform 0.3s ease;
}

.not-found-logo:hover {
    transform: scale(1.05);
}

.not-found-title {
    font-size: 1.75rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: -0.02em;
}

.not-found-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.back-link {
    color: var(--link-color);
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
    padding-bottom: 2px;
    transition: all 0.2s ease;
}

.back-link:hover {
    color: var(--link-hover-color);
    border-bottom-color: var(--link-hover-color);
}

.divider {
    color: rgba(255, 255, 255, 0.3);
}
