 :root {
      --bg1: #0f172a;               
      --bg2: #1e293b;               
      --card: #1e293b;              
      --surface: rgba(255, 255, 255, 0.05); 
      --text: #f8fafc;              
      --text-secondary: #cbd5e1;    
      --muted: #94a3b8;             
      --accent: #3b82f6;            
      --accent-light: #60a5fa;      
      --border: rgba(255, 255, 255, 0.1); 
      --glass: rgba(255, 255, 255, 0.03); 
      --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
      --heading-gradient: linear-gradient(135deg, #60a5fa 0%, #fff 100%); 
    }

    [data-theme="light"] {
      --bg1: #ffffff;
      --bg2: #f8fafc;
      --card: #ffffff;
      --surface: #f1f5f9; 
      --text: #0f172a;
      --text-secondary: #334155;
      --muted: #64748b;
      --accent: #2563eb;
      --accent-light: #3b82f6;
      --border: #e2e8f0;
      --glass: rgba(255, 255, 255, 0.9);
      --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
      --heading-gradient: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    }

    * { box-sizing: border-box; }

    body {
      margin: 0;
      font-family: 'Inter', sans-serif; 
      background: linear-gradient(135deg, var(--bg1), var(--bg2));
      color: var(--text);
      min-height: 100vh;
      -webkit-font-smoothing: antialiased; 
      -moz-osx-font-smoothing: grayscale;
      transition: background-color 0.3s ease, color 0.3s ease; 
    }
    
    header {
      position: sticky; 
      top: 0;
      z-index: 50; 
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 18px 28px;
      background: var(--glass);
      backdrop-filter: blur(8px); 
      border-bottom: 1px solid var(--border);
      height: 80px;
    }

    .brand { 
      display: flex; 
      align-items: center; 
      gap: 12px; 
      cursor: pointer;
    }

    .logo {
      width: 44px; 
      height: 44px; 
      border-radius: 10px; 
      display: grid; 
      place-items: center;
      background: linear-gradient(135deg, #60a5fa, #06b6d4); 
      font-weight: 800; 
      color: #04244b;
      box-shadow: 0 6px 18px rgba(2, 6, 23, 0.6);
    }
    
    h1 {
       font-size: 1.05rem; 
       letter-spacing: .6px; 
      }

    nav {
      position: absolute;
      left: 50%;
      transform: translateX(-50%); 
      display: flex;
      gap: 24px;
    }

    nav a {
      color: var(--muted); 
      text-decoration: none; 
      font-weight: 600; 
      padding: 8px 16px;
      border-radius: 8px; 
      transition: all 0.3s ease; 
    }

    nav a:hover, nav a.active { 
      background: var(--surface); color: var(--text); 
    }
    
    main { max-width: 1100px; margin: 0 auto; padding: 0 20px 80px; }

    .hero {
      min-height: calc(100vh - 120px); display: grid; grid-template-columns: 1fr 480px;
      gap: 32px; align-items: start; margin: 40px 0;
    }

    .intro {
      padding: 32px; background: var(--card); border-radius: 16px;
      border: 1px solid var(--border); box-shadow: var(--card-shadow);
    }

    .title {
      font-size: 2.8rem; font-weight: 800; line-height: 1.1; margin-bottom: 16px;
      background: var(--heading-gradient);
      background-clip: text;
      -webkit-background-clip: text; 
      -webkit-text-fill-color: transparent;
    }

    .lead { color: var(--muted); font-size: 1.05rem; margin-bottom: 18px; }

    .chips { display: flex; gap: 10px; flex-wrap: wrap; }

    .chip {
      background: var(--surface); padding: 8px 16px; border-radius: 999px;
      font-weight: 600; cursor: pointer; border: 1px solid var(--border);
      transition: all 0.2s ease;
    }

    .chip:hover {
      transform: translateY(-2px); background: var(--accent);
      color: white; border-color: var(--accent);
    }
    
    .chat-card {
      border-radius: 20px; background: var(--card); padding: 16px;
      border: 1px solid var(--border); box-shadow: var(--card-shadow);
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .chat-card:hover { transform: translateY(-5px); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12); }

    #messages {
      height: 420px; overflow-y: auto; padding: 18px;
      background: linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(255, 255, 255, 0.02));
      border-radius: 10px; display: flex; flex-direction: column;
      gap: 12px; scroll-behavior: smooth;
    }
    
    .msg {
      max-width: 78%; padding: 12px 14px; border-radius: 12px;
      font-size: 0.98rem; line-height: 1.4; opacity: 0; transform: translateY(6px);
      animation: fadeUp 0.3s forwards; 
    }

    .msg.user { margin-left: auto; background: var(--accent); color: white; border: none; }
    .msg.bot { background: var(--surface); color: var(--text); border: 1px solid var(--border); }

    .meta { display: block; font-size: 0.72rem; color: rgba(255, 255, 255, 0.55); margin-top: 8px; }

    @keyframes fadeUp { to { opacity: 1; transform: none; } }

    .input-row { display: flex; gap: 10px; margin-top: 10px; align-items: center; }

    .input-row input {
      flex: 1; padding: 12px 14px; border-radius: 10px;
      border: 1px solid var(--border); background: var(--surface);
      color: var(--text); font-size: 0.98rem;
    }

    .input-row input::placeholder { color: var(--muted); opacity: 0.8; }

    .input-row input:focus {
      outline: none; border-color: var(--accent);
      box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
    }

    .input-row button {
      background: linear-gradient(135deg, #06b6d4, #2563eb); border: none;
      color: #04244b; font-weight: 700; padding: 10px 14px;
      border-radius: 10px; cursor: pointer; box-shadow: 0 8px 18px rgba(2, 6, 23, 0.4);
      transition: all 0.3s ease;
    }

    .input-row button:active { transform: translateY(1px); }
    
    .article-list { margin-top: 10px; padding-left: 18px; }

    .article-list li {
      margin: 6px 0; padding: 6px 8px; background: rgba(255, 255, 255, 0.02);
      border-radius: 8px; font-size: 0.95rem; color: var(--muted);
    }

    .section-container { max-width: 1100px; margin: 0 auto; padding: 80px 20px; }

    .section-title {
      font-size: 2.5rem; font-weight: 800; text-align: center; margin-bottom: 48px;
      background: var(--heading-gradient); 
      -webkit-background-clip: text;
      background-clip: text;
      -webkit-text-fill-color: transparent;
    }

    .about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 32px; }

    .about-card {
      background: var(--card); border: 1px solid var(--border); padding: 32px;
      border-radius: 16px; text-align: center; transition: transform 0.3s ease;
    }

    .about-card:hover { transform: translateY(-5px); }

    .contact-form {
      max-width: 600px; margin: 0 auto; background: var(--card); padding: 40px;
      border-radius: 16px; border: 1px solid var(--border);
    }

    .submit-btn {
      width: 100%; padding: 12px; background: var(--accent); color: white;
      border: none; border-radius: 8px; font-size: 1rem; font-weight: 600;
      cursor: pointer; transition: transform 0.3s ease;
    }

    .submit-btn:hover { transform: translateY(-2px); }
    
    .footer {
      background: var(--card); border-top: 1px solid var(--border); padding: 24px 20px;
      margin-top: 40px; text-align: center; color: var(--muted); font-size: 0.95rem;
    }

    .theme-toggle {
      background: none; border: none; padding: 8px 12px; cursor: pointer;
      color: var(--muted); font-size: 1.2rem; border-radius: 8px;
      transition: all 0.3s ease;
    }

    .theme-toggle:hover { background: var(--surface); transform: translateY(-1px); }

    .chat-actions {
      display: flex;
      justify-content: center;
      gap: 12px;
      margin-top: 16px;
      padding-top: 12px;
      border-top: 1px solid var(--border);
    }

    .action-btn {
      background: var(--surface);
      color: var(--text);
      border: 1px solid var(--border);
      padding: 6px 12px;
      border-radius: 6px;
      font-size: 0.9rem;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .action-btn:hover {
      background: var(--accent);
      color: white;
    }

    .disclaimer {
      text-align: center;
      color: var(--muted);
      font-size: 0.85rem;
      margin-top: 12px;
    }
    
    @media (max-width: 980px) {
      header { flex-direction: column; height: auto; padding: 14px; }
      nav { position: relative; left: 0; transform: none; margin-top: 10px; }
      .hero { grid-template-columns: 1fr; min-height: auto; }
    }

    @media (max-width: 768px) {
      .section-container { padding: 40px 20px; }
      .section-title { font-size: 2rem; }
    }