:root {
  /* Bảng màu Cyberpunk */
  --cb-yellow: #fce205;
  --cb-pink: #ff003c;
  --cb-blue: #00f0ff;
  --cb-green: #39ff14;
  --cb-bg: #09090b;
  --cb-panel: #111116;
  --cb-panel-border: #1f1f2e;
  
  --text: #e0f8f8;
  --muted: #8a9ba8;
  --font-main: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* Lưới nền Cyberpunk & Scanlines */
body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background-color: var(--cb-bg);
  background-image: 
    linear-gradient(rgba(0, 240, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-main);
  line-height: 1.6;
}

/* Hiệu ứng sọc màn hình CRT */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15),
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
  z-index: 10;
}

img, iframe {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- HEADER --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 5vw;
  background: rgba(9, 9, 11, 0.9);
  border-bottom: 2px solid var(--cb-blue);
  backdrop-filter: blur(5px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--cb-yellow);
  text-shadow: 2px 2px 0px var(--cb-pink);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #000;
  background: var(--cb-yellow);
  font-weight: 900;
  clip-path: polygon(20% 0, 100% 0, 100% 80%, 80% 100%, 0 100%, 0 20%);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.94rem;
  font-weight: 700;
  text-transform: uppercase;
}

.site-nav a {
  color: var(--text);
  padding: 0.5rem 0;
  position: relative;
  transition: 0.3s;
}

.site-nav a::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--cb-pink);
  transition: 0.3s;
}

.site-nav a:hover {
  color: var(--cb-blue);
  text-shadow: 0 0 8px var(--cb-blue);
}

.site-nav a:hover::before {
  width: 100%;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--cb-blue);
  color: var(--cb-blue);
  cursor: pointer;
}

/* --- TYPOGRAPHY --- */
h1, h2, h3 {
  text-transform: uppercase;
  margin: 0;
  line-height: 1.1;
}

h1 {
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 900;
  color: #fff;
  text-shadow: 3px 0 var(--cb-blue), -3px 0 var(--cb-pink);
  letter-spacing: -2px;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--cb-yellow);
  text-shadow: 2px 2px 0px #000;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.2rem;
  color: var(--cb-blue);
}

.eyebrow {
  display: inline-block;
  background: var(--cb-pink);
  color: #000;
  padding: 4px 8px;
  font-weight: bold;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 1rem;
}

/* --- HERO SECTION --- */
.hero {
  min-height: calc(100vh - 72px);
  padding: 4rem 5vw;
}

.intro-hero-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 4rem;
}

.intro-welcome {
  color: var(--cb-green);
  font-size: 1.2rem;
  font-weight: bold;
}

.intro-welcome::before {
  content: "> ";
  color: var(--cb-pink);
}

.intro-welcome::after {
  content: "_";
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.intro-profile {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.intro-avatar {
  width: 220px;
  height: 220px;
  border: 3px solid var(--cb-yellow);
  padding: 5px;
  background: #000;
  clip-path: polygon(15% 0, 100% 0, 100% 85%, 85% 100%, 0 100%, 0 15%);
  position: relative;
  
  /* Đặt Avatar nằm dưới lớp sọc ngang (sọc ngang đang là 10) */
  z-index: 5; 
  transition: all 0.3s ease;
}

/* THÊM HIỆU ỨNG CHO KHUNG AVATAR KHI HOVER */
.intro-avatar:hover {
  /* Nổi bứt lên trên lớp sọc ngang */
  z-index: 20; 
  /* Tỏa ánh sáng Neon bám theo đường cắt polygon */
  filter: drop-shadow(0 0 15px rgba(252, 226, 5, 0.6)); 
}

/* Giữ nguyên phần hình ảnh bên trong (nếu bạn đã chỉnh theo ý muốn) */
.intro-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 12%; 
  transform: scale(1.05); 
  clip-path: polygon(15% 0, 100% 0, 100% 85%, 85% 100%, 0 100%, 0 15%);
  transition: 0.3s;
}

.intro-avatar:hover img {
  transform: scale(1.1);
}

.intro-tags {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.intro-tags span {
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid var(--cb-blue);
  color: var(--cb-blue);
  padding: 5px 15px;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.9rem;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

/* --- CARDS (Intro & Projects) --- */
.intro-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.intro-card, .project-card, .timeline li, .reflection-grid article {
  background: var(--cb-panel);
  border: 1px solid var(--cb-panel-border);
  padding: 2rem;
  position: relative;
  /* Cắt 1 góc đặc trưng cyberpunk */
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%);
  transition: all 0.2s ease-in-out;
}

.intro-card::after, .project-card::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  border-bottom: 20px solid var(--cb-yellow);
  border-left: 20px solid transparent;
  width: 0;
}

.intro-card:hover, .project-card:hover, .timeline li:hover, .reflection-grid article:hover {
  border-color: var(--cb-blue);
  background: rgba(0, 240, 255, 0.02);
  transform: translateY(-5px);
  box-shadow: -5px 5px 0px rgba(255, 0, 60, 0.4); /* Bóng đổ khối cứng */
}

.intro-icon {
  color: var(--cb-pink);
  font-size: 2rem;
  margin-bottom: 1rem;
  font-weight: 900;
}
.intro-icon::before {
  content: "[ SYS_ICON ]";
  font-size: 1rem;
}

.intro-card p, .project-card p {
  color: var(--muted);
  font-size: 0.95rem;
}

.hobby-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 1rem;
}

.hobby-grid span {
  background: #000;
  border: 1px solid var(--cb-green);
  color: var(--cb-green);
  padding: 5px;
  text-align: center;
  font-weight: bold;
  text-transform: uppercase;
}

/* --- SECTION GENERAL --- */
.section {
  padding: 6rem 5vw;
  position: relative;
  border-top: 1px dashed var(--cb-panel-border);
}

/* --- BUTTONS & ACTIONS --- */
.filter-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.filter-tab, .project-actions button, .project-actions a {
  background: transparent;
  border: 1px solid var(--cb-blue);
  color: var(--cb-blue);
  padding: 0.6rem 1.2rem;
  font-family: inherit;
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.filter-tab:hover, .project-actions button:hover, .project-actions a:hover {
  background: var(--cb-blue);
  color: #000;
  box-shadow: 0 0 15px var(--cb-blue);
}

.filter-tab.active {
  background: var(--cb-yellow);
  border-color: var(--cb-yellow);
  color: #000;
  box-shadow: 0 0 15px var(--cb-yellow);
}

.project-actions a {
  border-color: var(--cb-pink);
  color: var(--cb-pink);
}
.project-actions a:hover {
  background: var(--cb-pink);
  color: #000;
  box-shadow: 0 0 15px var(--cb-pink);
}

/* --- PROJECTS --- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.project-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.5rem;
}

.project-number {
  color: var(--cb-pink);
  font-size: 2rem;
  font-weight: 900;
}

.project-tag {
  background: #000;
  color: var(--cb-yellow);
  border: 1px solid var(--cb-yellow);
  padding: 2px 8px;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.project-points {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.project-points li {
  position: relative;
  padding-left: 1.5rem;
  color: var(--text);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.project-points li::before {
  content: ">";
  position: absolute;
  left: 0;
  color: var(--cb-green);
  font-weight: bold;
}

.project-actions {
  display: flex;
  gap: 1rem;
  margin-top: auto;
}

/* --- TIMELINE (Quy trình) --- */
.timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  list-style: none;
  padding: 0;
}

.timeline li {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.timeline span {
  font-size: 1.5rem;
  font-weight: 900;
  color: #000;
  background: var(--cb-blue);
  padding: 10px;
  clip-path: polygon(25% 0%, 100% 0%, 75% 100%, 0% 100%); /* Hình bình hành */
  min-width: 50px;
  text-align: center;
}

/* --- REFLECTION --- */
.reflection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

/* --- FOOTER --- */
.site-footer {
  padding: 2rem 5vw;
  background: #000;
  border-top: 2px solid var(--cb-yellow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--muted);
}

.site-footer a {
  color: var(--cb-yellow);
  text-transform: uppercase;
  font-weight: bold;
}
.site-footer a:hover {
  text-shadow: 0 0 10px var(--cb-yellow);
}

/* --- TÂN TRANG PDF MODAL (HỆ THỐNG HIỂN THỊ DỮ LIỆU) --- */

.pdf-modal {
  position: fixed;
  inset: 0;
  z-index: 999; /* Nổi lên trên cùng */
  display: none;
  background: rgba(5, 5, 10, 0.9); /* Nền đen sâu hơn */
  background-image: radial-gradient(circle at center, rgba(0, 240, 255, 0.1) 0%, transparent 60%);
  backdrop-filter: blur(10px);
  padding: 3vh 3vw;
}

.pdf-modal.open {
  display: block;
}

/* Khung viền công nghệ (Data Pad) */
.pdf-dialog {
  width: 100%;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  background: #050508;
  border: 1px solid var(--cb-blue);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.15), inset 0 0 15px rgba(0, 240, 255, 0.2);
  padding: 6px; /* Tạo viền bao quanh phần giấy trắng */
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Thêm 4 góc định vị màn hình (HUD Corners) */
.pdf-dialog::before, .pdf-dialog::after {
  content: "";
  position: absolute;
  width: 40px; 
  height: 40px;
  pointer-events: none;
  z-index: 10;
}
.pdf-dialog::before {
  top: -2px; left: -2px;
  border-top: 3px solid var(--cb-pink);
  border-left: 3px solid var(--cb-pink);
}
.pdf-dialog::after {
  bottom: -2px; right: -2px;
  border-bottom: 3px solid var(--cb-pink);
  border-right: 3px solid var(--cb-pink);
}

/* Header Terminal */
.pdf-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: #000;
  border-bottom: 2px solid var(--cb-blue);
  /* Lưới Grid kỹ thuật số trên Header */
  background-image: 
    linear-gradient(rgba(0, 240, 255, 0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.15) 1px, transparent 1px);
  background-size: 10px 10px;
}

.pdf-header h2 {
  color: var(--cb-blue);
  font-size: 1.1rem;
  text-shadow: 0 0 8px var(--cb-blue);
  margin: 0;
  letter-spacing: 1px;
}
.pdf-header h2::before {
  content: "C:\\SECURE_DOCS> ";
  color: var(--cb-yellow);
}
/* Con trỏ nhấp nháy */
.pdf-header h2::after {
  content: " \2588"; /* Ký tự ô vuông đặc */
  animation: blink 1s step-end infinite;
  color: var(--cb-blue);
}

/* Nút thoát khẩn cấp */
.pdf-close {
  background: rgba(255, 0, 60, 0.1);
  color: var(--cb-pink);
  border: 1px solid var(--cb-pink);
  width: 35px;
  height: 35px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(255, 0, 60, 0.2);
  transition: 0.2s;
}

.pdf-close:hover {
  background: var(--cb-pink);
  color: #000;
  box-shadow: 0 0 20px var(--cb-pink);
}

/* Khung tài liệu trắng */
.pdf-dialog iframe {
  width: 100%;
  height: 100%;
  border: 1px solid #222; /* Viền tối mỏng quanh tờ giấy trắng */
  background: #fff; 
  opacity: 0.96; /* Hạ độ sáng của PDF trắng xuống 4% để bớt chói mắt so với nền đen */
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  .site-header {
    flex-wrap: wrap;
  }
  
  .nav-toggle {
    display: block;
  }
  
  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 0;
    background: #000;
    border-bottom: 2px solid var(--cb-blue);
    position: absolute;
    top: 72px;
    left: 0;
    padding-left: 5vw;
  }
  
  .site-nav.open {
    display: flex;
  }

  .intro-profile {
    flex-direction: column;
    align-items: flex-start;
  }
  
  h1 {
    font-size: 2.5rem;
  }
  
  .intro-avatar {
    width: 150px;
    height: 150px;

    object-position: center 5%; 
  
    clip-path: polygon(15% 0, 100% 0, 100% 85%, 85% 100%, 0 100%, 0 15%);
    transition: 0.3s;
  }
  
  .project-actions {
    flex-direction: column;
  }
  
  .pdf-modal {
    padding: 0;
  }
  .pdf-dialog {
    border: none;
  }
}

/* Hiệu ứng chọn văn bản (Selection) */
::selection {
  background: var(--cb-pink);
  color: #fff;
}