:root {
    /* Color Palette - Quiet Industrial Lab Theme */
    --bg-dark: #f4f7f6;
    --bg-card: rgba(255, 255, 255, 0.86);
    --text-bright: #111827;
    --text-muted: #64748b;
    
    --accent-blue: #0f766e;
    --accent-indigo: #2563eb;
    --accent-emerald: #10b981;
    --accent-violet: #a16207;
    
    --gradient-primary: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo));
    --gradient-mesh: linear-gradient(180deg, #eef5f3 0%, #f8fafc 42%, #edf2f7 100%);
    
    /* Typography */
    --font-sans: 'Inter', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
    
    /* Effects */
    --glass-border: 1px solid rgba(15, 23, 42, 0.1);
    --glass-shadow: 0 18px 42px rgba(15, 23, 42, 0.13);
    --transition-premium: cubic-bezier(0.23, 1, 0.32, 1);
}

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

html {
    scroll-behavior: smooth;
    background-color: var(--bg-dark);
}

body {
    font-family: var(--font-sans);
    color: var(--text-bright);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    background: var(--bg-dark);
}

/* Mesh Background */
.mesh-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--gradient-mesh);
    z-index: -1;
    background-attachment: fixed;
}

.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(15, 23, 42, 0.045) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(15, 23, 42, 0.045) 1px, transparent 1px);
    background-size: 38px 38px;
    opacity: 0.28;
    z-index: -1;
    pointer-events: none;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 0.95rem 10%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 8px 26px rgba(15, 23, 42, 0.06);
    transition: all 0.5s var(--transition-premium);
}

.navbar.scrolled {
    padding: 0.8rem 10%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(22px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.logo-img {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(15, 23, 42, 0.1);
}

.logo-text {
    font-size: 1.18rem;
    font-weight: 800;
    letter-spacing: 0;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: #1f2937;
    font-size: 0.95rem;
    font-weight: 700;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--accent-blue);
}

/* Hero Section */
.hero {
    min-height: 86vh;
    display: flex;
    align-items: center;
    padding: 0 10%;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(90deg, rgba(244, 247, 246, 0.98) 0%, rgba(244, 247, 246, 0.86) 36%, rgba(244, 247, 246, 0.36) 68%, rgba(244, 247, 246, 0.1) 100%),
                      url("assets/moad.png");
    background-size: cover;
    background-position: center right;
    z-index: 0;
}

.hero::after {
    content: '';
    position: absolute;
    left: 10%;
    right: 10%;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(15, 118, 110, 0.35), transparent);
    z-index: 1;
}

.hero-content {
    max-width: 720px;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    padding: 0.45rem 0.7rem;
    background: rgba(15, 118, 110, 0.08);
    border: 1px solid rgba(15, 118, 110, 0.18);
    border-radius: 6px;
    color: var(--accent-blue);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
}

.hero h1 {
    font-size: 4.25rem;
    line-height: 1.02;
    font-weight: 900;
    margin-bottom: 1.5rem;
    letter-spacing: 0;
    max-width: 760px;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.12rem;
    color: var(--text-muted);
    max-width: 640px;
    margin-bottom: 2.2rem;
}

.hero-btns {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.88rem 1.35rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.4s var(--transition-premium);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 12px 28px rgba(15, 118, 110, 0.18);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(15, 118, 110, 0.24);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.74);
    color: #0f172a;
    border: var(--glass-border);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-2px);
}

.hero-signals {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin-top: 1.4rem;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 700;
}

.hero-signals span {
    padding: 0.35rem 0.55rem;
    border-left: 2px solid rgba(15, 118, 110, 0.42);
    background: rgba(255, 255, 255, 0.48);
}

/* Sections */
.section-container {
    padding: 6rem 10% 7rem;
}

.section-header {
    margin-bottom: 2.6rem;
}

.section-header p {
    color: var(--text-muted);
    max-width: 680px;
    margin-top: 0.75rem;
}

.section-label {
    color: var(--accent-blue);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: block;
    margin-bottom: 1rem;
}

.section-header h2 {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: 0;
}

/* Project Matrix */
.project-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.1rem;
    max-width: 1120px;
}

.home-workspace {
    padding-top: 5rem;
}

.home-section-header {
    display: grid;
    grid-template-columns: minmax(260px, 0.72fr) minmax(280px, 1fr);
    align-items: end;
    gap: 1.5rem;
    max-width: 1180px;
}

.home-section-header .section-label,
.home-section-header h2 {
    grid-column: 1;
}

.home-section-header p {
    grid-column: 2;
    grid-row: 1 / span 2;
    margin: 0;
    font-size: 1rem;
}

.home-project-grid {
    grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
    grid-auto-rows: minmax(154px, auto);
    gap: 1rem;
    max-width: 1180px;
}

.home-project-grid .featured-card {
    grid-row: span 3;
    min-height: 610px;
}

.home-project-grid .featured-card .project-img-wrapper {
    height: 350px;
}

.home-project-grid .featured-card .project-body {
    padding: 1.6rem;
}

.home-project-grid .featured-card h3 {
    font-size: 1.55rem;
}

.home-project-grid .featured-card .project-body p {
    flex-grow: 0;
}

.feature-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0.15rem 0 1.2rem;
}

.feature-tags span {
    padding: 0.32rem 0.55rem;
    border-radius: 6px;
    background: rgba(15, 118, 110, 0.07);
    border: 1px solid rgba(15, 118, 110, 0.16);
    color: #0f766e;
    font-size: 0.78rem;
    font-weight: 700;
}

.home-project-grid .project-card:not(.featured-card) {
    display: grid;
    grid-template-columns: 38% 1fr;
    min-height: 0;
}

.home-project-grid .project-card:not(.featured-card) .project-img-wrapper {
    height: auto;
    min-height: 154px;
}

.home-project-grid .project-card:not(.featured-card) .project-badge {
    top: 0.75rem;
    right: 0.75rem;
    font-size: 0.68rem;
}

.home-project-grid .project-card:not(.featured-card) .project-body {
    padding: 1rem;
}

.home-project-grid .project-card:not(.featured-card) h3 {
    font-size: 1.05rem;
}

.home-project-grid .project-card:not(.featured-card) p {
    font-size: 0.86rem;
    margin-bottom: 0.75rem;
}

.project-card {
    background: var(--bg-card);
    border: var(--glass-border);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
    display: flex;
    flex-direction: column;
    min-height: 420px;
    height: auto;
    position: relative;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
}

.project-card:hover {
    transform: translateY(-4px);
    border-color: rgba(15, 118, 110, 0.32);
    box-shadow: var(--glass-shadow);
}

.project-img-wrapper {
    height: 190px;
    overflow: hidden;
    position: relative;
}

.project-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s var(--transition-premium);
}

.project-card:hover img {
    transform: scale(1.04);
}

.project-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.35rem 0.65rem;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(10px);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-blue);
    border: 1px solid rgba(15, 118, 110, 0.2);
}

.project-body {
    padding: 1.35rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-body h3 {
    font-size: 1.2rem;
    margin-bottom: 0.65rem;
    font-weight: 700;
}

.project-body p {
    color: var(--text-muted);
    font-size: 0.94rem;
    margin-bottom: 1.2rem;
    flex-grow: 1;
}

.project-link {
    font-weight: 700;
    color: var(--accent-blue);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.3s;
}

.project-card:hover .project-link {
    gap: 0.8rem;
}

/* Footer */
footer {
    padding: 2rem 10%;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
    text-align: center;
    background: rgba(255, 255, 255, 0.72);
}

.footer-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-logo {
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0;
}

.copyright {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.filing-links {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
    justify-content: center;
    color: var(--text-muted);
}

.filing-links::before {
    content: '';
    width: 1px;
    height: 16px;
    background: rgba(100, 116, 139, 0.35);
}

.beian,
.beian a,
.police-beian {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-decoration: none;
    transition: color 0.3s ease;
}

.beian:hover,
.beian a:hover,
.police-beian:hover {
    color: var(--accent-blue);
}

.police-beian {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.police-beian img {
    width: 16px;
    height: 18px;
    object-fit: contain;
    display: block;
}

/* Animations */
[data-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s var(--transition-premium);
}

[data-reveal].active {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.65rem;
    }
    
    .section-header h2 {
        font-size: 1.9rem;
    }
    
    .project-grid {
        grid-template-columns: 1fr;
    }

    footer {
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }

    .filing-links::before {
        display: none;
    }

    .filing-links {
        justify-content: center;
    }
}

/* ============================================
   VISUAL ENHANCEMENTS (Appended — Do Not Edit Above)
   ============================================ */

/* --- 1. Custom Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.3);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(56, 189, 248, 0.5);
}

/* --- 2. Text Selection --- */
::selection {
    background: rgba(56, 189, 248, 0.3);
    color: #fff;
}

/* --- 3. Nav Link Underline Animation --- */
.nav-links a {
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 2px;
    transition: width 0.4s var(--transition-premium);
}

.nav-links a:hover::after {
    width: 100%;
}

/* --- 4. Hero Breathing Gradient --- */
@keyframes meshBreathe {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.mesh-bg {
    animation: meshBreathe 8s ease-in-out infinite;
}

/* --- 5. Project Card Shimmer Effect --- */
.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.03),
        transparent
    );
    transition: left 0.8s var(--transition-premium);
    z-index: 1;
    pointer-events: none;
}

.project-card:hover::before {
    left: 150%;
}

/* --- 6. Card Glow Border on Hover --- */
.project-card:hover {
    box-shadow:
        0 0 0 1px rgba(56, 189, 248, 0.2),
        0 20px 60px rgba(56, 189, 248, 0.1),
        0 0 40px rgba(99, 102, 241, 0.05);
}

/* --- 7. Staggered Reveal Delays --- */
.project-card:nth-child(1) { transition-delay: 0s; }
.project-card:nth-child(2) { transition-delay: 0.1s; }
.project-card:nth-child(3) { transition-delay: 0.2s; }
.project-card:nth-child(4) { transition-delay: 0.3s; }

/* --- 8. Hero Badge Pulse --- */
@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(56, 189, 248, 0); }
}

.hero-badge {
    animation: badgePulse 3s ease-in-out infinite;
}

/* --- 9. Point Card Hover Glow (Detail Pages) --- */
.point-card:hover {
    box-shadow: 0 10px 30px rgba(56, 189, 248, 0.08);
}

/* --- 10. Side Nav Active Indicator --- */
.side-nav a.active {
    color: var(--accent-blue);
    font-weight: 700;
}

.side-nav a.active::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    background: var(--accent-blue);
    border-radius: 2px;
}

.side-nav li {
    position: relative;
}

/* --- 11. Back Button Enhancement --- */
.back-btn {
    text-decoration: none;
}

.back-btn:hover svg {
    transform: translateX(-3px);
    transition: transform 0.3s ease;
}

/* --- 12. Footer Polish --- */
footer {
    background: rgba(2, 6, 23, 0.5);
    backdrop-filter: blur(10px);
}

/* --- 13. Image Load Transition --- */
.project-card img {
    opacity: 0;
    animation: fadeInImg 0.6s ease forwards;
}

@keyframes fadeInImg {
    to { opacity: 1; }
}

.project-card:nth-child(1) img { animation-delay: 0.1s; }
.project-card:nth-child(2) img { animation-delay: 0.2s; }
.project-card:nth-child(3) img { animation-delay: 0.3s; }
.project-card:nth-child(4) img { animation-delay: 0.4s; }

/* --- 14. Button Ripple Glow --- */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: var(--gradient-primary);
    filter: blur(15px);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.4s ease;
}

.btn-primary:hover::after {
    opacity: 0.5;
}

/* --- 15. Smooth Page Load --- */
@keyframes pageIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

body {
    animation: pageIn 0.6s ease-out;
}

/* --- 16. Homepage Refresh Overrides --- */
.project-card:hover {
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.13);
}

.hero-badge {
    animation: none;
}

footer {
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(14px);
}

/* --- 17. Shared Page Refresh --- */
.detail-section {
    background: rgba(255, 255, 255, 0.9) !important;
    border-radius: 8px !important;
    border: 1px solid rgba(15, 23, 42, 0.1) !important;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.1);
    backdrop-filter: blur(14px) !important;
}

.detail-section h3,
.content-body h1,
.content-body h2,
.content-body h3,
.point-card h4 {
    color: var(--text-bright) !important;
}

.content-body h2 {
    background: none !important;
    -webkit-text-fill-color: var(--text-bright) !important;
}

.content-body p,
.point-card p {
    color: var(--text-muted) !important;
    opacity: 1 !important;
}

.point-card {
    background: rgba(255, 255, 255, 0.92) !important;
    border-radius: 8px !important;
    border: 1px solid rgba(15, 23, 42, 0.1) !important;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.point-card:hover {
    background: #fff !important;
    border-color: rgba(15, 118, 110, 0.32) !important;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
}

.point-card img {
    border-radius: 8px !important;
    border: 1px solid rgba(15, 23, 42, 0.1) !important;
}

.side-nav ul {
    border-left: 2px solid rgba(15, 23, 42, 0.12) !important;
}

.side-nav a {
    color: #64748b !important;
}

.side-nav a:hover,
.side-nav a.active {
    color: var(--accent-blue) !important;
}

.callout {
    background: rgba(15, 118, 110, 0.07) !important;
    border-radius: 0 8px 8px 0 !important;
}

.spec-table th,
.spec-table td {
    border-bottom: 1px solid rgba(15, 23, 42, 0.09) !important;
}

code {
    background: rgba(15, 118, 110, 0.08) !important;
    color: #0f766e !important;
}

@media (max-width: 980px) {
    .navbar {
        padding: 1rem 6%;
    }

    .hero {
        min-height: 84vh;
        padding: 7rem 6% 4rem;
    }

    .hero::before {
        background-image: linear-gradient(180deg, rgba(244, 247, 246, 0.98) 0%, rgba(244, 247, 246, 0.9) 58%, rgba(244, 247, 246, 0.74) 100%),
                          url("assets/moad.png");
        background-position: center;
    }

    .section-container {
        padding: 4rem 6% 5rem;
    }

    .project-grid {
        grid-template-columns: 1fr;
        max-width: 680px;
    }

    .home-section-header {
        display: block;
    }

    .home-section-header p {
        margin-top: 0.75rem;
    }

    .home-project-grid .featured-card {
        min-height: 0;
    }

    .home-project-grid .featured-card .project-img-wrapper {
        height: 230px;
    }

    .home-project-grid .project-card:not(.featured-card) {
        display: flex;
        min-height: 0;
    }

    .home-project-grid .project-card:not(.featured-card) .project-img-wrapper {
        height: 190px;
    }

    footer {
        padding: 1.8rem 6%;
    }
}

@media (max-width: 560px) {
    .logo-text {
        font-size: 1rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .nav-links a {
        font-size: 0.85rem;
    }

    .hero h1 {
        font-size: 2.25rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero-btns {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        justify-content: center;
    }
}
