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

:root {
    --bg: #0a0a0f;
    --bg-elevated: #12121a;
    --fg: #e8e6e3;
    --fg-muted: #8a8680;
    --accent: #c9a96e;
    --accent-glow: rgba(201, 169, 110, 0.15);
    --card-bg: rgba(255,255,255,0.03);
    --card-border: rgba(255,255,255,0.06);
    --radius: 16px;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Noto Sans SC', sans-serif;
    background: var(--bg);
    color: var(--fg);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* === Background atmosphere === */
.bg-glow {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.bg-glow::before {
    content: '';
    position: absolute;
    top: -20%; left: -10%;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(201,169,110,0.06) 0%, transparent 70%);
    animation: float1 20s ease-in-out infinite;
}
.bg-glow::after {
    content: '';
    position: absolute;
    bottom: -10%; right: -10%;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(110,140,201,0.05) 0%, transparent 70%);
    animation: float2 25s ease-in-out infinite;
}
@keyframes float1 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(80px, 60px); }
}
@keyframes float2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-60px, -40px); }
}

/* === Grid noise overlay === */
.noise {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* === Layout === */
.container {
    position: relative;
    z-index: 2;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
}

/* === Nav === */
nav {
    padding: 32px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.nav-brand {
    font-family: 'Noto Serif SC', serif;
    font-weight: 700;
    font-size: 18px;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: 0.02em;
}
.nav-links {
    display: flex;
    gap: 32px;
    list-style: none;
}
.nav-links a {
    color: var(--fg-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    transition: color 0.3s;
}
.nav-links a:hover { color: var(--fg); }

/* === WeChat QR popup === */
.nav-qr { position: relative; margin-left: 12px; }
.nav-qr-btn {
    display: flex; align-items: center; gap: 4px;
    color: var(--fg-muted); text-decoration: none; font-size: 14px;
    cursor: pointer; transition: color 0.3s; user-select: none;
}
.nav-qr-btn:hover { color: var(--accent); }
.nav-qr-popup {
    display: none; position: absolute; top: 40px; right: 0; z-index: 999;
    background: var(--bg-elevated); border: 1px solid var(--card-border);
    border-radius: 12px; padding: 16px; text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4); width: 160px;
}
.nav-qr-popup img { width: 120px; height: 120px; border-radius: 8px; margin-bottom: 8px; display: block; margin-left: auto; margin-right: auto; }
.nav-qr-popup span { font-size: 12px; color: var(--fg-muted); }
@keyframes fadeIn { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }

/* === Hero === */
.hero {
    padding: 80px 0 60px;
    text-align: center;
}
.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    border: 1px solid var(--card-border);
    border-radius: 100px;
    font-size: 12px;
    color: var(--fg-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 32px;
    background: var(--card-bg);
}
.hero h1 {
    font-family: 'Noto Serif SC', serif;
    font-weight: 900;
    font-size: clamp(40px, 8vw, 72px);
    line-height: 1.15;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}
.hero h1 .accent {
    background: linear-gradient(135deg, var(--accent) 0%, #e8c98a 50%, var(--accent) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 4s linear infinite;
}
@keyframes shimmer {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}
.hero-intro { max-width: 680px; margin: 0 auto; text-align: left; }
.hero-intro p + p { margin-top: 14px; }
.hero p {
    font-size: 18px;
    color: var(--fg-muted);
    max-width: none;
    margin: 0 auto;
    font-weight: 400;
    line-height: 1.8;
}

/* === Section === */
section { padding: 40px 0; }
.section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 40px;
}
.section-header h2 {
    font-family: 'Noto Serif SC', serif;
    font-weight: 700;
    font-size: 24px;
    white-space: nowrap;
}
.section-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--card-border), transparent);
}
.section-header .section-tag {
    font-size: 12px;
    color: var(--fg-muted);
    letter-spacing: 0.05em;
}

#project-notes { margin-top: 56px; }

/* === Project Cards === */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}
.project-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 32px 28px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: block;
}
.project-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0;
    transition: opacity 0.4s;
}
.project-card:hover {
    border-color: rgba(201,169,110,0.2);
    background: rgba(255,255,255,0.05);
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.project-card:hover::before { opacity: 1; }

.project-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 20px;
    position: relative;
}
.project-icon.up2u { background: linear-gradient(135deg, #ff654322, #c9a96e22); color: #ff8066; }
.project-icon.palmplanet { background: #4f8ae12c; color: #91bcff; }
.project-icon.haoverse { background: #3eada529; color: #85d5c9; }
.project-icon.momentnest { background: #b88f6e32; color: #efbd96; }
.project-icon.note { background: #a19cdb21; color: #c0b9ed; }
.project-icon.onetake { background: linear-gradient(135deg, #667eea22, #764ba222); color: #a78bfa; }
.project-icon.coach { background: linear-gradient(135deg, #f59e0b22, #ef444422); color: #fbbf24; }
.project-icon.whsk-game { background: linear-gradient(135deg, #f4d35e26, #eb6f5c20); color: #f4d35e; font-size: 14px; font-weight: 800; }
.project-icon.whsk-algorithm { background: linear-gradient(135deg, #176b522d, #3f6d8a24); color: #5fd0a8; font-size: 14px; font-weight: 800; }

.project-card.featured {
    border-color: rgba(201,169,110,0.22);
    background: linear-gradient(145deg, rgba(201,169,110,0.08), rgba(255,255,255,0.025));
}

.project-card h3 {
    font-family: 'Noto Serif SC', serif;
    font-weight: 700;
    font-size: 20px;
    margin-bottom: 4px;
}
.project-card .subtitle {
    font-size: 12px;
    color: var(--accent);
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}
.project-card .desc {
    font-size: 14px;
    color: var(--fg-muted);
    line-height: 1.7;
    font-weight: 300;
}
.project-card .card-arrow {
    position: absolute;
    top: 32px; right: 28px;
    font-size: 18px;
    color: var(--fg-muted);
    opacity: 0;
    transform: translate(-8px, 8px);
    transition: all 0.4s;
}
.project-card:hover .card-arrow {
    opacity: 1;
    transform: translate(0, 0);
}
.project-status {
    display: inline-block;
    margin-top: 16px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.03em;
}
.status-live { background: rgba(16,185,129,0.12); color: #34d399; }
.status-beta { background: rgba(201,169,110,0.12); color: var(--accent); }
.status-dev { background: rgba(99,102,241,0.12); color: #818cf8; }

/* === About === */
.about-section {
    padding: 60px 0;
    text-align: center;
}
.about-section p {
    max-width: 600px;
    margin: 0 auto;
    color: var(--fg-muted);
    font-size: 15px;
    line-height: 2;
    font-weight: 300;
}
.wechat-hint {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    padding: 10px 24px;
    border: 1px solid var(--card-border);
    border-radius: 100px;
    font-size: 14px;
    color: var(--fg-muted);
    background: var(--card-bg);
}
.wechat-hint .dot {
    width: 6px; height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* === Footer === */
footer {
    position: relative;
    z-index: 2;
    padding: 40px 0 32px;
    border-top: 1px solid var(--card-border);
    text-align: center;
}
footer .footer-inner {
    font-size: 13px;
    color: var(--fg-muted);
    line-height: 1.8;
}
footer a {
    color: var(--fg-muted);
    text-decoration: none;
    transition: color 0.3s;
}
footer a:hover { color: var(--fg); }

/* === Responsive === */
@media (max-width: 640px) {
    nav { padding: 20px 0; }
    .nav-links { gap: 20px; }
    .nav-qr { margin-left: 8px; }
    .nav-qr-btn { font-size: 13px; }
    .nav-qr-popup { top: 36px; width: 140px; padding: 12px; }
    .nav-qr-popup img { width: 100px; height: 100px; }
    .nav-links a { font-size: 13px; }
    .hero { padding: 48px 0 40px; }
    .hero p { font-size: 16px; }
    .projects-grid { grid-template-columns: 1fr; }
    section { padding: 24px 0; }
    .section-header { margin-bottom: 24px; }
}

.nav-qr[open] .nav-qr-popup { display: block; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.lang-switch { color: var(--accent); font-size: 13px; white-space: nowrap; text-underline-offset: 4px; }
.nav-qr-btn { cursor: pointer; list-style: none; }
.nav-qr-btn::-webkit-details-marker { display: none; }
.hero-actions { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-top: 26px; }
.hero-actions a { padding: 10px 16px; border: 1px solid #c9a96e66; border-radius: 8px; color: var(--fg); text-decoration: none; }
.hero-actions a:first-child { background: var(--accent); color: var(--bg); font-weight: 700; }
.hero-actions a:hover { border-color: var(--accent); }
.project-icon.guiwei { background: #7694772c; color: #a2c9a5; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
@media (max-width: 500px) {
    nav { flex-wrap: wrap; gap: 12px; }
    .nav-links { order: 3; width: 100%; flex-wrap: wrap; justify-content: flex-start; gap: 8px 14px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .bg-glow::before, .bg-glow::after { animation: none; }
}
