/* =========================================================
   全局样式表 - Ivan Meng Portfolio
   基于 Design System v1.0
   ========================================================= */

/* =========================================================
       1. 全局变量与系统设定 (基于 Design System v1.0)
       ========================================================= */
    :root {
      --bg-main: #0a0a0a;
      --bg-card: #141414;
      --text-main: #ffffff;
      --text-muted: #a1a1aa;
      --accent: #3b82f6;
      --border-subtle: rgba(255, 255, 255, 0.08);
      --container-max: 1200px;
    }

    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    body {
      font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
      background-color: var(--bg-main);
      color: var(--text-main);
      line-height: 1.6;
      overflow-x: hidden;
      -webkit-font-smoothing: antialiased;
    }

    a {
      text-decoration: none;
      color: inherit;
    }

    ul {
      list-style: none;
    }

    .container {
      max-width: var(--container-max);
      margin: 0 auto;
      padding: 0 24px;
      position: relative;
      z-index: 10;
    }

    @media (min-width: 768px) {
      .container {
        padding: 0 48px;
      }
    }

    /* =========================================================
       2. 导航栏交互 (Nav)
       ========================================================= */
    nav {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 50;
      padding: 24px;
      transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .nav-scrolled {
      background: rgba(10, 10, 10, 0.8);
      backdrop-filter: blur(20px) saturate(180%);
      -webkit-backdrop-filter: blur(20px) saturate(180%);
      border-bottom: 1px solid var(--border-subtle);
      padding: 16px 24px;
    }

    .logo {
      font-weight: 700;
      font-size: 1.25rem;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .logo-icon {
      width: 24px; height: 24px; background: #fff; border-radius: 6px;
    }

    .nav-links {
      display: none;
      gap: 32px;
      color: var(--text-muted);
      font-size: 0.9rem;
      font-weight: 500;
      align-items: center;
    }

    .nav-links a:hover {
      color: var(--text-main);
      transition: color 0.3s ease;
    }
    
    .nav-contacts {
      display: none;
      align-items: center;
      gap: 20px;
      font-size: 13px;
      color: var(--text-muted);
    }
    .nav-contacts a:hover { color: var(--text-main); }

    /* 微信二维码悬停容器 */
    .wechat-wrapper {
      position: relative;
      display: inline-flex;
    }
    .wechat-qr {
      position: absolute;
      top: calc(100% + 15px);
      right: 0;
      width: 220px;
      border-radius: 12px;
      box-shadow: 0 20px 40px rgba(0,0,0,0.9);
      opacity: 0;
      visibility: hidden;
      transform: translateY(-10px) scale(0.95);
      transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
      z-index: 100;
      border: 1px solid rgba(255,255,255,0.15);
      pointer-events: none;
    }
    .wechat-wrapper:hover .wechat-qr {
      opacity: 1;
      visibility: visible;
      transform: translateY(0) scale(1);
    }

    @media (min-width: 1024px) {
      .nav-links { display: flex; }
      .nav-contacts { display: flex; }
    }

    /* 按钮系统 */
    .btn-primary {
      display: inline-flex; align-items: center; gap: 8px;
      padding: 12px 24px; background: #ffffff; color: #0a0a0a;
      font-size: 14px; font-weight: 600; border-radius: 9999px;
      border: none; cursor: pointer; transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    }
    .btn-primary:hover {
      transform: scale(1.02); box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    }

    .btn-secondary {
      display: inline-flex; align-items: center; gap: 8px;
      padding: 12px 24px; background: transparent; color: #ffffff;
      font-size: 14px; font-weight: 500; border-radius: 9999px;
      border: 1px solid rgba(255, 255, 255, 0.2); cursor: pointer;
      transition: all 0.3s ease;
    }
    .btn-secondary:hover {
      background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.3);
    }

    /* =========================================================
       3. 首屏强光晕排版与右侧人像 (Hero Section)
       ========================================================= */
    .hero-section {
      padding: 180px 0 100px;
      position: relative;
      min-height: 90vh;
      display: flex;
      align-items: center;
    }

    .hero-glow {
      position: absolute; 
      right: -15%; 
      top: -5%;
      width: 1000px; 
      height: 1000px;
      background: radial-gradient(circle at 75% 25%, rgba(220, 50, 50, 0.2) 0%, rgba(255, 235, 210, 0.1) 20%, transparent 60%);
      filter: blur(90px); 
      pointer-events: none;
      z-index: 0;
      opacity: 0.8;
      animation: pulse-glow 6s ease-in-out infinite alternate;
    }
    
    @keyframes pulse-glow {
      0% { opacity: 0.7; transform: scale(1); }
      100% { opacity: 1; transform: scale(1.05); }
    }

    /* 双栏容器 */
    .hero-inner {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 60px;
      width: 100%;
    }

    .hero-content {
      position: relative; z-index: 10;
      flex: 1;
      max-width: 680px;
    }

    /* 右侧人像渲染样式 */
    .hero-visual {
      position: relative; 
      z-index: 10;
      flex: 1;
      max-width: 420px;
      animation: float 6s ease-in-out infinite;
    }

    .hero-visual img {
      width: 100%;
      height: auto;
      border-radius: 24px;
      border: 1px solid rgba(255, 255, 255, 0.1);
      /* 匹配红色主基调的阴影渲染 */
      box-shadow: 0 30px 60px -15px rgba(220, 30, 30, 0.25), 0 20px 40px -10px rgba(0, 0, 0, 0.8);
      /* 底部渐隐融入黑底 */
      -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
      mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
    }

    @keyframes float {
      0% { transform: translateY(0px); }
      50% { transform: translateY(-15px); }
      100% { transform: translateY(0px); }
    }

    @media (max-width: 992px) {
      .hero-inner { flex-direction: column; align-items: flex-start; }
      .hero-visual { max-width: 100%; margin-top: 40px; }
    }

    .status-pill {
      display: inline-flex; align-items: center; gap: 8px;
      padding: 6px 16px; border: 1px solid var(--border-subtle);
      border-radius: 999px; font-size: 13px; color: var(--text-muted);
      margin-bottom: 32px; backdrop-filter: blur(10px);
    }
    .status-pill::before {
      content: ''; width: 8px; height: 8px; background: #fff; border-radius: 50%;
    }

    .hero-title {
      font-size: clamp(40px, 6vw, 64px);
      font-weight: 700; line-height: 1.1; letter-spacing: -0.02em;
      margin-bottom: 24px;
    }
    .hero-title span { color: var(--text-muted); }

    .hero-desc {
      font-size: 18px; color: var(--text-muted); max-width: 600px;
      margin-bottom: 48px; line-height: 1.6;
    }

    .hero-actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }

    /* =========================================================
       4. 关于我 (Bento Grid & Motion Blur)
       ========================================================= */
    .section-title {
      font-size: 40px; font-weight: 600; letter-spacing: -0.01em;
      margin-bottom: 48px; margin-top: 120px;
    }

    .about-grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 24px;
    }
    @media (min-width: 1024px) {
      .about-grid { grid-template-columns: 1fr 1.5fr 1fr; }
    }

    .glass-card {
      background: rgba(20, 20, 20, 0.6);
      backdrop-filter: blur(20px) saturate(180%);
      -webkit-backdrop-filter: blur(20px) saturate(180%);
      border: 1px solid var(--border-subtle); border-radius: 16px;
      box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), inset 0 1px 0 0 rgba(255,255,255,0.05);
      padding: 32px;
      will-change: transform; transform: translateZ(0); transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    }
    .glass-card:hover {
      background: rgba(25, 25, 25, 0.7); border-color: rgba(255, 255, 255, 0.12);
      transform: translateY(-2px);
    }

    .about-text { display: flex; flex-direction: column; justify-content: space-between; gap: 24px; }
    .about-text p { color: var(--text-muted); font-size: 15px; }
    .about-text strong { color: var(--text-main); }
    
    .location-tag { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; }

    .portrait-container {
      position: relative; overflow: hidden; border-radius: 16px;
      min-height: 300px; height: 100%; border: 1px solid var(--border-subtle);
    }
    .portrait-base {
      width: 100%; height: 100%; object-fit: cover; filter: contrast(1.1) saturate(1.2); position: absolute; inset: 0;
    }
    .portrait-blur {
      position: absolute; inset: 0;
      background: url('https://images.unsplash.com/photo-1518770660439-4636190af475?q=80&w=1000&auto=format&fit=crop') center/cover;
      filter: blur(20px) brightness(1.3) saturate(1.5);
      opacity: 0.6; mix-blend-mode: screen;
      transform: translateX(30px) scale(1.1);
      mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.5) 30%, black 100%);
      -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.5) 30%, black 100%);
      animation: drift 6s ease-in-out infinite;
    }
    @keyframes drift {
      0%, 100% { transform: translateX(20px) scale(1.1); }
      50% { transform: translateX(40px) scale(1.15); }
    }

    .stats-container { display: flex; flex-direction: column; gap: 24px; }
    .stat-item {
      flex: 1; padding: 24px; background: rgba(20,20,20,0.4); border-radius: 16px;
      border: 1px solid var(--border-subtle); display: flex; flex-direction: column; justify-content: center;
    }
    .stat-number { font-size: 48px; font-weight: 700; line-height: 1; margin-bottom: 8px; letter-spacing: -0.02em; }
    .stat-label { color: var(--text-muted); font-size: 14px; }

    /* =========================================================
       5. 核心能力 (Skills & Services)
       ========================================================= */
    .skills-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
    @media (min-width: 768px) { .skills-grid { grid-template-columns: repeat(3, 1fr); } }

    .skill-card {
      padding: 32px 24px; background: rgba(20, 20, 20, 0.5); border: 1px solid var(--border-subtle);
      border-radius: 16px; transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    }
    .skill-card:hover { background: rgba(25, 25, 25, 0.8); border-color: rgba(255,255,255,0.1); transform: translateY(-4px); }
    
    .skill-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; font-size: 20px; font-weight: 600; }
    .skill-icon { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.05); border-radius: 12px; border: 1px solid rgba(255,255,255,0.1); }
    
    .skill-list { padding-left: 0; }
    .skill-list li { position: relative; padding-left: 20px; margin-bottom: 12px; font-size: 15px; color: var(--text-muted); }
    .skill-list li::before { content: ''; position: absolute; left: 0; top: 10px; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; }

    /* =========================================================
       6. 作品集 (Featured Projects)
       ========================================================= */
    .projects-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
    @media (min-width: 768px) { .projects-grid { grid-template-columns: repeat(2, 1fr); } }

    .project-card {
      display: block; position: relative; border-radius: 16px; overflow: hidden; background: var(--bg-card);
      border: 1px solid var(--border-subtle); transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1); cursor: pointer;
    }
    .project-card:hover { transform: translateY(-8px); border-color: rgba(255,255,255,0.15); }
    
    .card-image-wrapper { position: relative; overflow: hidden; aspect-ratio: 16/10; background: #000; }
    .card-image { width: 100%; height: 100%; object-fit: cover; opacity: 0.8; transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1); }
    .project-card:hover .card-image { transform: scale(1.05); opacity: 1; }
    
    .card-image-wrapper::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 60%; background: linear-gradient(to top, rgba(0,0,0,0.8), transparent); pointer-events: none; }
    
    .card-arrow {
      position: absolute; top: 20px; right: 20px; width: 44px; height: 44px;
      background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.1);
      border-radius: 50%; display: flex; align-items: center; justify-content: center;
      opacity: 0; transform: translate(-10px, 10px); transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1); z-index: 2;
    }
    .card-arrow svg { width: 20px; height: 20px; color: white; transform: rotate(-45deg); transition: transform 0.3s ease; }
    .project-card:hover .card-arrow { opacity: 1; transform: translate(0, 0); }
    .project-card:hover .card-arrow svg { transform: rotate(0deg); }

    .card-content { padding: 24px; position: absolute; bottom: 0; left: 0; right: 0; z-index: 2; }
    .card-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: rgba(255,255,255,0.1); backdrop-filter: blur(4px); border: 1px solid rgba(255,255,255,0.1); border-radius: 99px; font-size: 11px; font-weight: 500; color: #fff; margin-bottom: 12px; }
    .card-title { font-size: 20px; font-weight: 600; margin-bottom: 8px; color: #fff; }
    .card-desc { font-size: 14px; color: rgba(255,255,255,0.7); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

    /* 底部 */
    footer { padding: 60px 0; text-align: center; color: var(--text-muted); font-size: 14px; margin-top: 80px; border-top: 1px solid var(--border-subtle); }
    .footer-contacts { display: flex; justify-content: center; gap: 24px; margin-bottom: 16px; }
    .footer-contacts a:hover { color: var(--text-main); }