:root {
  --primary: #0f62fe;
  --primary-hover: #0353e9;
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1c1917;
  --muted: #475569;
  --border: #e2e8f0;
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1140px;
  margin: auto;
  padding: 40px 20px;
}
.container.print-mode {
  .btns {
    display: none;
  }
}

/* --- HERO SECTION --- */
.hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 50px;
  align-items: center;
  background: var(--card);
  border-radius: 24px;
  padding: 50px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
  margin-bottom: 30px;
}

.badge {
  display: inline-block;
  padding: 6px 14px;
  background: #eef4ff;
  border-radius: 6px;
  color: var(--primary);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 15px;
}

h1 {
  font-size: 46px;
  font-weight: 800;
  line-height: 1.15;
  color: #0f172a;
  letter-spacing: -1px;
  margin-bottom: 10px;
}

.hero h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 20px;
}

.hero p {
  font-size: 16px;
  color: var(--muted);
  max-width: 540px;
  text-align: justify;
}

.btns {
  margin-top: 30px;
  display: flex;
  gap: 12px;
}

.btns a {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-outline {
  border: 1px solid var(--border);
  color: var(--text);
  background: #fff;
}

.btn-outline:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.photo {
  display: flex;
  justify-content: center;
}

.photo img {
  width: 100%;
  max-width: 320px;
  height: auto;
  border-radius: 20px;
  box-shadow: 0 15px 40px rgba(15, 98, 254, 0.1);
}

/* --- COMMON SECTION STYLE --- */
section {
  margin-bottom: 30px;
}

h2 {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 15px;
  position: relative;
  padding-left: 15px;
}

h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 4px;
  background: var(--primary);
  border-radius: 2px;
}

.card {
  background: var(--card);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.01);
}

.summary-text {
  font-size: 16px;
  color: #334155;
  line-height: 1.7;
  text-align: justify;
}

/* --- TRUSTED IMPACT (GRID 5) --- */
.grid5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.metric {
  background: var(--card);
  border-radius: 16px;
  padding: 20px 15px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
  border: 1px solid #f1f5f9;
}

.metric strong {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
  display: block;
  margin-bottom: 2px;
  letter-spacing: -0.5px;
}

.metric span {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

/* --- LEADERSHIP JOURNEY (TIMELINE) --- */
.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.timeline-item {
  background: var(--card);
  border-radius: 16px;
  padding: 25px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
  border-left: 4px solid var(--primary);
  transition: transform 0.2s ease;
}

.timeline-item:hover {
  transform: translateX(4px);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.timeline-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.timeline-header .time-badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: #eef4ff;
  padding: 4px 12px;
  border-radius: 6px;
}

.timeline-item b {
  font-size: 14.5px;
  color: var(--muted);
  display: block;
  margin-bottom: 10px;
  font-weight: 500;
}

.timeline-item ul {
  padding-left: 20px;
  font-size: 14.5px;
  color: #334155;
}

.timeline-item ul li {
  margin-bottom: 6px;
  text-align: justify;
}

/* --- PRODUCTS & PLATFORMS --- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.product-card {
  background: var(--card);
  border-radius: 16px;
  padding: 25px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
}

.product-card h3 {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}

.product-card p {
  font-size: 14px;
  color: var(--muted);
  text-align: justify;
}

/* --- TECHNICAL EXPERTISE (TAGS) --- */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tags span {
  display: inline-block;
  background: #f1f5f9;
  color: #334155;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.tags span:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* --- DOUBLE COLUMN GRID --- */
.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.meta-card p {
  font-size: 15px;
  color: #334155;
}

/* --- FOOTER & CONTACT --- */
.footer-contact {
  background: #0f172a;
  color: white;
  border-radius: 24px;
  padding: 40px;
  margin-top: 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 30px;
}

.footer-contact h2 {
  color: white;
  padding: 0;
  margin-bottom: 10px;
}

.footer-contact h2::before {
  display: none;
}

.footer-info p {
  font-size: 15px;
  color: #94a3b8;
  margin-bottom: 8px;
}

.footer-info a {
  color: #38bdf8;
  text-decoration: none;
}

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 992px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 30px;
    padding: 35px;
  }

  .hero p {
    margin: auto;
  }

  .btns {
    justify-content: center;
  }

  .photo {
    order: -1;
  }

  .grid5 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .grid5 {
    grid-template-columns: repeat(2, 1fr);
  }

  .products-grid,
  .meta-grid,
  .footer-contact {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 36px;
  }

  .timeline-header {
    flex-direction: column;
    gap: 5px;
  }
}

/* =====================================================================
   BỘ CSS XUẤT PDF TRÊN NỀN TRẮNG CHUẨN IN ẤN (TỐI ƯU ẢNH & BỐ CỤC)
   ===================================================================== */
@media print {
    /* 1. Ép toàn bộ nền về màu trắng 100% để hợp với giấy in, chữ màu đậm rõ nét */
    html, body {
        background: #ffffff !important;
        color: #0f172a !important; /* Màu xanh đen slate đậm nét cao cấp */
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        font-size: 13px !important; /* Hạ nhẹ font-size tổng thể để nội dung cô đọng */
        line-height: 1.5 !important;
    }

    /* 2. Thiết lập khổ trang A4 dọc với khoảng cách lề (Margin) an toàn */
    @page {
        size: A4 portrait;
        margin: 1.2cm 1.5cm; /* Tối ưu lề để chứa được nhiều thông tin hơn */
    }

    /* Ẩn các nút điều hướng thao tác */
    .btns, .no-print, .lang-toggle-btn {
        display: none !important;
    }

    /* =====================================================================
       XỬ LÝ THU NHỎ ẢNH & TỐI ƯU CỤM HERO (TOP HEADER)
       ===================================================================== */
    /* Giả định cấu hình Khối Header của anh dùng Flex hoặc Grid */
    .hero-container, .header-wrap {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 20px !important;
        border-bottom: 2px solid #e2e8f0 !important; /* Kẻ vạch ngang phân cách nhẹ */
        padding-bottom: 15px !important;
        margin-bottom: 20px !important;
    }

    /* THU NHỎ ẢNH CHÂN DUNG: Giới hạn kích thước nhỏ gọn góc phải */
    .hero-container img, .header-wrap img, .avatar-class {
        width: 100px !important;       /* Thu nhỏ ảnh lại còn khoảng 100px-110px */
        height: 100px !important;
        object-fit: cover !important;
        border-radius: 8px !important;  /* Bo góc nhẹ tinh tế */
        box-shadow: none !important;    /* Xóa đổ bóng nặng nề của bản web */
    }

    /* Phần chữ bên cạnh ảnh */
    .hero-text {
        flex: 1 !important;
    }

    /* =====================================================================
       CẤU TRÚC LẠI CÁC KHỐI ĐỂ GIỮ BỐ CỤC KHÔNG BỊ PHÌNH TRANG
       ===================================================================== */
    /* Biến các khối "Trusted Impact" (5 ô số) thành hàng ngang cố định, đổ nền xám cực nhẹ */
    .grid5 {
        display: grid !important;
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 10px !important;
        margin-bottom: 20px !important;
    }

    .metric, .impact-card {
        background: #f8fafc !important; /* Nền xám rất nhẹ làm nổi bật số */
        border: 1px solid #e2e8f0 !important;
        padding: 8px !important;
        text-align: center !important;
        border-radius: 6px !important;
    }

    /* Biến khối "Products & Platforms Built" thành 2 cột đều nhau khi in */
    .products-grid, .projects-container {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 15px !important;
    }

    /* Định dạng lại các box Section trên nền trắng: Thay đổ bóng bằng viền mảnh */
    .section, .card, .timeline .item, .project-card {
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important; /* Dùng viền nhẹ thay cho box-shadow */
        box-shadow: none !important;
        padding: 12px 15px !important;
        margin-bottom: 12px !important;
        border-radius: 6px !important;
        
        /* CHÍ MẠNG: Chống chặt đôi khối nội dung khi nhảy trang */
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    /* Thu gọn khoảng cách Timeline của phần Leadership Journey */
    .timeline {
        margin-top: 10px !important;
    }
    .timeline .item {
        margin-bottom: 10px !important;
        padding-bottom: 10px !important;
    }

    /* Làm gọn phần Technical Expertise (Các tag kỹ năng) */
    .badge, .skill-tag {
        background: #f1f5f9 !important;
        color: #334155 !important;
        border: 1px solid #cbd5e1 !important;
        padding: 3px 8px !important;
        font-size: 11px !important;
        display: inline-block !important;
        margin: 2px !important;
    }
    
    /* Cụm footer Let's Connect cuối trang */
    .footer-connect {
        background: #0f172a !important; /* Giữ khối đen này ở cuối để làm điểm nhấn chốt Portfolio */
        color: #ffffff !important;
        padding: 15px !important;
        border-radius: 6px !important;
    }
}