/* ============================================================
   PORTFOLIO HỌC TẬP — CSS STYLES
   Author: Nguyễn Văn A
   Version: 1.0
   Structure:
     1. CSS Variables (Design Tokens)
     2. Reset & Base
     3. Typography
     4. Layout Utilities
     5. Progress Bar
     6. Navbar
     7. Hero Section
     8. Projects Section
     9. Project Cards & Accordion
    10. Reflection Section
    11. Contact Section
    12. Footer
    13. Back to Top
    14. Animations & Scroll Reveals
    15. Dark Mode
    16. Responsive (Tablet + Mobile)
   ============================================================ */

/* ─── 1. CSS VARIABLES ─── */
:root {
  /* Primary palette */
  --navy:       #1a3a5c;
  --navy-mid:   #2d5f8a;
  --navy-light: #3a7bbf;
  --accent:     #e8a020;
  --accent-soft:#fef3dc;

  /* Neutrals */
  --white:  #ffffff;
  --bg:     #f7f8fc;
  --bg-card:#ffffff;
  --border: #dde3ee;
  --text:   #1a1e2e;
  --text-2: #4a5568;
  --text-3: #718096;
  --shadow: rgba(26, 58, 92, 0.10);
  --shadow-hover: rgba(26, 58, 92, 0.18);

  /* Category colors */
  --hardware: #2d6a9f;
  --data:     #0d7b6e;
  --ai:       #7b3fc4;
  --collab:   #c45a1d;
  --content:  #1b7c3d;
  --ethics:   #a0202e;

  /* Spacing */
  --gap-xs: 0.4rem;
  --gap-sm: 0.8rem;
  --gap-md: 1.5rem;
  --gap-lg: 2.5rem;
  --gap-xl: 4rem;
  --gap-2xl: 6rem;

  /* Radius */
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-xl: 28px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur: 0.28s;

  /* Navbar height */
  --nav-h: 64px;

  /* Font */
  --font-display: 'Lora', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, sans-serif;
}

/* Dark mode tokens */
[data-theme="dark"] {
  --bg:     #0e1522;
  --bg-card:#16202f;
  --border: #2a3a52;
  --text:   #e8eef8;
  --text-2: #a0b4cc;
  --text-3: #6a88a8;
  --shadow: rgba(0, 0, 0, 0.35);
  --shadow-hover: rgba(0, 0, 0, 0.5);
  --accent-soft: rgba(232, 160, 32, 0.12);
  --navy-light: #5aa5e0;
}

/* ─── 2. RESET & BASE ─── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 8px);
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--navy-light);
  text-decoration: none;
  transition: color var(--dur) var(--ease), opacity var(--dur);
}

a:hover { opacity: 0.8; }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; }

/* ─── 3. TYPOGRAPHY ─── */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  line-height: 1.25;
  color: var(--text);
}

h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); font-weight: 700; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); font-weight: 600; }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); font-weight: 600; }
h4 { font-size: 1.05rem; font-weight: 600; }
h5 { font-size: 0.95rem; font-weight: 600; }

p { margin-bottom: var(--gap-sm); }
p:last-child { margin-bottom: 0; }

code {
  font-family: 'Courier New', monospace;
  background: var(--accent-soft);
  color: var(--navy);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.88em;
}

[data-theme="dark"] code {
  color: var(--accent);
}

/* ─── 4. LAYOUT UTILITIES ─── */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 var(--gap-md);
}

.section {
  padding: var(--gap-2xl) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--gap-xl);
}

.section-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy-light);
  background: rgba(58, 123, 191, 0.12);
  padding: 4px 14px;
  border-radius: 50px;
  margin-bottom: var(--gap-sm);
}

.section-title {
  margin-bottom: var(--gap-sm);
}

.section-subtitle {
  color: var(--text-2);
  max-width: 560px;
  margin: 0 auto;
  font-size: 1.05rem;
}

/* ─── 5. PROGRESS BAR ─── */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--navy), var(--accent));
  z-index: 9999;
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
}

/* ─── 6. NAVBAR ─── */
#navbar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(247, 248, 252, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur), background var(--dur), box-shadow var(--dur);
}

[data-theme="dark"] #navbar {
  background: rgba(14, 21, 34, 0.92);
}

#navbar.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 2px 16px var(--shadow);
}

.nav-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 var(--gap-md);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-md);
}

/* Logo */
.nav-logo {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.04em;
}

[data-theme="dark"] .nav-logo { color: var(--white); }

.logo-bracket {
  color: var(--accent);
  font-weight: 400;
}

/* Desktop links */
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
}

.nav-link {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-2);
  padding: 6px 14px;
  border-radius: 50px;
  transition: background var(--dur), color var(--dur);
}

.nav-link:hover,
.nav-link.active {
  color: var(--navy);
  background: rgba(58, 123, 191, 0.1);
}

[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .nav-link.active {
  color: var(--white);
  background: rgba(90, 165, 224, 0.15);
}

/* Nav actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
}

/* Theme toggle */
.theme-btn {
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  position: relative;
  overflow: hidden;
  transition: border-color var(--dur), background var(--dur), transform var(--dur);
}

.theme-btn:hover {
  border-color: var(--navy-light);
  transform: scale(1.08);
}

.theme-icon {
  position: absolute;
  transition: transform 0.35s var(--ease), opacity 0.35s;
}

.theme-icon.sun  { transform: translateY(0); opacity: 1; }
.theme-icon.moon { transform: translateY(30px); opacity: 0; }

[data-theme="dark"] .theme-icon.sun  { transform: translateY(-30px); opacity: 0; }
[data-theme="dark"] .theme-icon.moon { transform: translateY(0); opacity: 1; }

/* Hamburger */
.menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
}

.hamburger-line {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s, width 0.3s;
}

.menu-btn[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.menu-btn[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
  width: 0;
}
.menu-btn[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile menu dropdown */
.mobile-menu {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: var(--gap-sm) 0;
  box-shadow: 0 8px 24px var(--shadow);
}

.mobile-menu ul {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 var(--gap-md);
}

.mobile-link {
  display: block;
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  border-radius: var(--r-md);
  transition: background var(--dur);
}

.mobile-link:hover {
  background: rgba(58, 123, 191, 0.1);
}

/* ─── 7. HERO SECTION ─── */
.hero-section {
  position: relative;
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: var(--gap-xl) 0;
}

/* Decorative background */
.hero-bg-decoration {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.bg-circle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.06;
  background: var(--navy);
}

[data-theme="dark"] .bg-circle {
  background: var(--navy-light);
  opacity: 0.08;
}

.circle-1 {
  width: 600px;
  height: 600px;
  top: -200px;
  right: -150px;
}

.circle-2 {
  width: 400px;
  height: 400px;
  bottom: -100px;
  left: -100px;
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.35;
}

.hero-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--gap-xl);
  align-items: center;
  position: relative;
  z-index: 1;
}

/* Avatar */
.hero-avatar-col {
  display: flex;
  justify-content: center;
}

.avatar-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-sm);
}

.avatar-frame {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--navy);
  box-shadow: 0 0 0 8px rgba(26, 58, 92, 0.08), 0 16px 48px var(--shadow);
  transition: transform 0.4s var(--ease), box-shadow 0.4s;
}

.avatar-frame:hover {
  transform: scale(1.03) rotate(-1deg);
  box-shadow: 0 0 0 8px rgba(26, 58, 92, 0.12), 0 24px 60px var(--shadow-hover);
}

.avatar-img { width: 100%; height: 100%; }

.avatar-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  padding: 5px 14px;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-2);
  box-shadow: 0 2px 8px var(--shadow);
}

.badge-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.3); }
}

/* Hero info */
.hero-tag {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy-light);
  margin-bottom: var(--gap-sm);
}

.hero-name {
  margin-bottom: var(--gap-sm);
  color: var(--navy);
}

[data-theme="dark"] .hero-name { color: var(--white); }

.name-highlight {
  color: var(--accent);
  font-style: italic;
}

.hero-major {
  font-size: 1.1rem;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.major-icon { font-style: normal; }

.hero-university {
  font-size: 0.92rem;
  color: var(--text-3);
  margin-bottom: var(--gap-md);
}

/* Interest tags */
.hero-interests {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--gap-md);
}

.tag-label {
  font-size: 0.85rem;
  color: var(--text-3);
  font-weight: 500;
}

.interest-tag {
  background: var(--accent-soft);
  color: var(--navy);
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 500;
  border: 1px solid rgba(232, 160, 32, 0.25);
}

[data-theme="dark"] .interest-tag {
  color: var(--accent);
}

/* Goals */
.hero-goals {
  margin-bottom: var(--gap-md);
}

.goals-title,
.objectives-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-bottom: var(--gap-sm);
  font-family: var(--font-body);
}

.goals-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.goals-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.96rem;
  color: var(--text-2);
}

.goal-icon { font-style: normal; flex-shrink: 0; }

/* Portfolio objectives */
.portfolio-objectives { margin-bottom: var(--gap-lg); }

.objectives-grid {
  display: flex;
  gap: var(--gap-sm);
  flex-wrap: wrap;
}

.obj-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: var(--r-md);
  font-size: 0.88rem;
  color: var(--text-2);
  flex: 1 1 200px;
  transition: border-color var(--dur), transform var(--dur);
}

.obj-item:hover {
  border-color: var(--navy-light);
  transform: translateY(-2px);
  cursor: pointer;
}

.obj-num {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy-light);
  min-width: 28px;
}

/* CTA buttons */
.hero-cta {
  display: flex;
  gap: var(--gap-sm);
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
}

.btn:hover { opacity: 1; }

.btn-primary {
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 4px 20px rgba(26, 58, 92, 0.3);
}

.btn-primary:hover {
  background: var(--navy-mid);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(26, 58, 92, 0.35);
  color: var(--white);
}

.btn-secondary {
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--navy);
}

.btn-secondary:hover {
  background: var(--navy);
  color: var(--white);
  transform: translateY(-2px);
}

[data-theme="dark"] .btn-secondary {
  color: var(--white);
  border-color: var(--white);
}

[data-theme="dark"] .btn-secondary:hover {
  background: var(--white);
  color: var(--navy);
}

.btn-arrow {
  font-size: 1.1rem;
  transition: transform var(--dur);
}

.btn-primary:hover .btn-arrow { transform: translateX(4px); }

/* ─── 8. PROJECTS SECTION ─── */
.projects-section {
  background: var(--bg);
}

/* Filter bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: var(--gap-lg);
}

.filter-btn {
  padding: 7px 18px;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-2);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all var(--dur);
}

.filter-btn:hover {
  border-color: var(--navy-light);
  color: var(--navy-light);
}

.filter-btn.active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

[data-theme="dark"] .filter-btn.active {
  background: var(--navy-mid);
  border-color: var(--navy-mid);
}

/* Projects grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
  gap: var(--gap-md);
}

/* ─── 9. PROJECT CARDS ─── */
.project-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: border-color var(--dur), box-shadow var(--dur), transform var(--dur);
}

.project-card:hover {
  border-color: var(--navy-light);
  box-shadow: 0 8px 32px var(--shadow);
  transform: translateY(-3px);
}

.project-card.hidden { display: none; }

/* Card header (always visible) */
.card-header {
  padding: var(--gap-md) var(--gap-md) 0;
  display: flex;
  align-items: flex-start;
  gap: var(--gap-sm);
  flex-wrap: wrap;
}

.card-number {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--border);
  line-height: 1;
  min-width: 52px;
  flex-shrink: 0;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  flex: 1;
  padding-top: 4px;
}

/* Category badge */
.card-category {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 50px;
}

.card-category.hardware { background: rgba(45, 106, 159, 0.12); color: var(--hardware); }
.card-category.data     { background: rgba(13, 123, 110, 0.12); color: var(--data); }
.card-category.ai       { background: rgba(123, 63, 196, 0.12); color: var(--ai); }
.card-category.collab   { background: rgba(196, 90, 29, 0.12);  color: var(--collab); }
.card-category.content  { background: rgba(27, 124, 61, 0.12);  color: var(--content); }
.card-category.ethics   { background: rgba(160, 32, 46, 0.12);  color: var(--ethics); }

.card-status {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 50px;
  background: rgba(34, 197, 94, 0.1);
  color: #15803d;
}

[data-theme="dark"] .card-status { color: #4ade80; background: rgba(74, 222, 128, 0.1); }

/* Accordion trigger button */
.accordion-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-sm);
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: var(--gap-sm) var(--gap-md) var(--gap-md);
  color: inherit;
  transition: background var(--dur);
  border-radius: 0 0 var(--r-md) var(--r-md);
}

.accordion-btn:hover {
  background: rgba(58, 123, 191, 0.04);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.accordion-icon {
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--navy-light);
  flex-shrink: 0;
  transition: transform 0.3s var(--ease);
  line-height: 1;
}

.accordion-btn[aria-expanded="true"] .accordion-icon {
  transform: rotate(45deg);
}

/* Card body */
.card-body {
  border-top: 1px solid var(--border);
  padding: var(--gap-md);
  display: flex;
  flex-direction: column;
  gap: var(--gap-md);
  animation: slideDown 0.3s var(--ease);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card-section { display: flex; flex-direction: column; gap: 8px; }

.sub-heading {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  margin-bottom: 4px;
}

/* Process list */
.process-list {
  list-style: decimal;
  padding-left: 1.4rem;
  color: var(--text-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.95rem;
}

/* Code block */
.code-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--gap-sm) var(--gap-md);
  overflow-x: auto;
}

.code-block pre { margin: 0; }
.code-block code {
  background: none;
  padding: 0;
  font-size: 0.84rem;
  line-height: 1.8;
  color: var(--text);
}

/* Naming rules */
.naming-rules {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding: var(--gap-sm) var(--gap-md);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 0.9rem;
}

.naming-rules h5 { margin-bottom: 6px; }
.naming-rules ul { list-style: disc; padding-left: 1.2rem; color: var(--text-2); }
.naming-rules li { margin-bottom: 4px; }

/* Tools grid */
.tools-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tool-tag {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 0.82rem;
  padding: 4px 12px;
  border-radius: 50px;
}

/* Results grid */
.results-grid {
  display: flex;
  gap: var(--gap-sm);
  flex-wrap: wrap;
}

.result-item {
  flex: 1 1 100px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--gap-sm) var(--gap-md);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.result-num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--navy-light);
  line-height: 1;
}

.result-label {
  font-size: 0.78rem;
  color: var(--text-3);
  line-height: 1.3;
}

/* Image / Video placeholders */
.image-placeholder,
.video-placeholder {
  background: var(--bg);
  border: 2px dashed var(--border);
  border-radius: var(--r-md);
  padding: var(--gap-lg);
  text-align: center;
  color: var(--text-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: border-color var(--dur);
}

.image-placeholder:hover,
.video-placeholder:hover {
  border-color: var(--navy-light);
}

.placeholder-icon { font-size: 2rem; }
.placeholder-hint { font-size: 0.75rem; color: var(--navy-light); font-style: italic; }

/* Skills tags */
.skills-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  background: rgba(26, 58, 92, 0.08);
  color: var(--navy);
  border: 1px solid rgba(26, 58, 92, 0.15);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 50px;
}

[data-theme="dark"] .skill-tag {
  background: rgba(90, 165, 224, 0.1);
  color: var(--navy-light);
  border-color: rgba(90, 165, 224, 0.2);
}

/* Attachments row */
.card-attachments {
  flex-direction: row !important;
  flex-wrap: wrap;
  padding-top: var(--gap-sm);
  border-top: 1px solid var(--border);
}

.attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all var(--dur);
  border: 1.5px solid;
}

.pdf-btn {
  background: rgba(160, 32, 46, 0.08);
  color: var(--ethics);
  border-color: rgba(160, 32, 46, 0.25);
}

.pdf-btn:hover {
  background: var(--ethics);
  color: white;
  opacity: 1;
}

.video-btn {
  background: rgba(123, 63, 196, 0.08);
  color: var(--ai);
  border-color: rgba(123, 63, 196, 0.25);
}

.video-btn:hover {
  background: var(--ai);
  color: white;
  opacity: 1;
}

.video-btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── Bài 2: Search demo ── */
.search-demo {
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
  margin-bottom: var(--gap-sm);
}

.search-example {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--gap-sm) var(--gap-md);
}

.search-example.good {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.04);
}

.search-label {
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.search-label.bad  { color: var(--ethics); }
.search-label.good { color: var(--data); }

.search-query {
  font-family: monospace;
  font-size: 0.88rem;
  color: var(--text);
  background: var(--bg-card);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  margin-bottom: 6px;
  word-break: break-all;
}

.search-result-count { font-size: 0.8rem; color: var(--text-3); }

.operator-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.operator-table caption {
  text-align: left;
  font-size: 0.82rem;
  color: var(--text-3);
  margin-bottom: 8px;
  font-weight: 600;
  caption-side: top;
}

.operator-table th,
.operator-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.operator-table thead th {
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
}

.operator-table tbody tr:hover td { background: var(--bg); }

/* CRAAP grid */
.craap-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.craap-item {
  flex: 1 1 140px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--gap-sm) var(--gap-md);
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.88rem;
}

.craap-item strong {
  font-size: 1rem;
  color: var(--navy-light);
}

.craap-item span { color: var(--text-2); }

/* ── Bài 3: Prompt comparison ── */
.prompt-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-sm);
  margin-bottom: var(--gap-sm);
}

.prompt-box {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--gap-sm) var(--gap-md);
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prompt-box.after {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.03);
}

.prompt-label {
  font-weight: 700;
  font-size: 0.82rem;
}

.prompt-text {
  font-family: monospace;
  font-size: 0.83rem;
  background: var(--bg-card);
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--text);
  line-height: 1.5;
}

.prompt-issues, .prompt-improvements {
  font-size: 0.85rem;
  color: var(--text-2);
}

.prompt-issues ul, .prompt-improvements ul {
  list-style: disc;
  padding-left: 1.2rem;
  margin-top: 4px;
}

.ai-output {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  font-size: 0.83rem;
  color: var(--text-2);
  font-style: italic;
}

.ai-output.good { border-color: #86efac; }

/* Prompt tips */
.prompt-tips { margin-top: var(--gap-sm); }
.prompt-tips h5 { margin-bottom: 8px; }

.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.tip-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  font-size: 0.85rem;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-2);
}

.tip-num {
  background: var(--navy);
  color: white;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Bài 4: Workflow diagram ── */
.workflow-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--gap-xs);
  padding: var(--gap-sm) 0;
  margin-bottom: var(--gap-sm);
}

.workflow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 14px;
  min-width: 90px;
  text-align: center;
  transition: transform var(--dur);
}

.workflow-step:hover { transform: translateY(-2px); }
.workflow-step.active {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.06);
}

.wf-icon { font-size: 1.3rem; }
.wf-label { font-size: 0.78rem; font-weight: 600; color: var(--text); }
.wf-tool { font-size: 0.72rem; color: var(--text-3); }
.wf-arrow { color: var(--text-3); font-size: 1.2rem; }

.collab-evidence h5 { margin-bottom: 8px; }

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.evidence-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--gap-sm) var(--gap-md);
  font-size: 0.88rem;
}

.evidence-icon { font-size: 1.2rem; display: block; margin-bottom: 4px; }
.evidence-item strong { display: block; margin-bottom: 2px; }
.evidence-item p { font-size: 0.8rem; color: var(--text-3); margin: 0; }

/* ── Bài 5: Content showcase ── */
.content-showcase {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap-sm);
}

.showcase-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* KHUNG ẢNH */
.showcase-preview {
  width: 100%;
  height: 220px;              /* chiều cao cố định */
  
  display: flex;
  justify-content: center;
  align-items: center;

  overflow: hidden;
  border-radius: 12px;
  box-sizing: border-box;
}

/* ẢNH */
.showcase-image {
  width: 100%;
  height: 100%;              /* quan trọng */
  object-fit: contain;       /* giữ đủ ảnh */
  display: block;
}

.showcase-info strong {
  font-size: 0.9rem;
  display: block;
  margin-bottom: 2px;
}

.showcase-info p {
  font-size: 0.8rem;
  color: var(--text-3);
  margin-bottom: 4px;
}

/* ── Bài 6: Principles ── */
.principles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.principle-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--gap-sm) var(--gap-md);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: border-color var(--dur), transform var(--dur);
}

.principle-card:hover {
  border-color: var(--navy-light);
  transform: translateY(-2px);
}

.principle-num {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy-light);
  min-width: 24px;
}

.principle-content strong { font-size: 0.92rem; display: block; margin-bottom: 3px; }
.principle-content p { font-size: 0.83rem; color: var(--text-2); margin: 0; }

.checklist-box {
  background: var(--accent-soft);
  border: 1px solid rgba(232, 160, 32, 0.2);
  border-radius: var(--r-md);
  padding: var(--gap-sm) var(--gap-md);
}

.checklist-box h5 { margin-bottom: 8px; }

.checklist {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.checklist li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-2);
}

.check { color: #22c55e; font-size: 1rem; }

/* ─── 10. REFLECTION SECTION ─── */
.reflection-section {
  background: var(--bg);
}

.reflection-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap-md);
}

.reflection-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--gap-lg);
  transition: border-color var(--dur), box-shadow var(--dur), transform var(--dur);
  animation-delay: var(--delay, 0s);
}

.reflection-card:hover {
  border-color: var(--navy-light);
  box-shadow: 0 8px 32px var(--shadow);
  transform: translateY(-3px);
}

.reflect-icon {
  font-size: 1.8rem;
  margin-bottom: var(--gap-sm);
  display: block;
}

.reflection-card h3 {
  font-size: 1.15rem;
  margin-bottom: var(--gap-sm);
  color: var(--navy);
}

[data-theme="dark"] .reflection-card h3 { color: var(--white); }

.reflection-card p { font-size: 0.93rem; color: var(--text-2); }

/* Skills achieved bars */
.skills-achieved {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skill-achieve-item {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 4px;
  align-items: center;
}

.achieve-label {
  font-size: 0.85rem;
  color: var(--text-2);
}

.achieve-pct {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--navy-light);
}

.achieve-bar {
  grid-column: 1 / -1;
  display: block;
  height: 6px;
  background: var(--border);
  border-radius: 50px;
  overflow: hidden;
  position: relative;
}

.achieve-bar::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: var(--level, 0%);
  background: linear-gradient(90deg, var(--navy), var(--navy-light));
  border-radius: 50px;
  transition: width 1.2s var(--ease) 0.3s;
}

/* Initially collapsed for animation */
.achieve-bar.animate-off::after { width: 0; }

/* Challenge list */
.challenge-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.challenge-list li {
  font-size: 0.92rem;
  color: var(--text-2);
  padding-left: 12px;
  border-left: 3px solid var(--accent);
}

/* Proud card */
.proud-card { border-left: 4px solid var(--accent); }

.proud-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.98rem;
  color: var(--navy);
  border-left: none;
  padding: var(--gap-sm) var(--gap-md);
  background: var(--accent-soft);
  border-radius: var(--r-md);
  margin: var(--gap-sm) 0;
  quotes: "\201C""\201D";
}

.proud-quote::before { content: open-quote; font-size: 1.5rem; color: var(--accent); }

[data-theme="dark"] .proud-quote { color: var(--text); }

/* Future timeline */
.future-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  padding-left: 20px;
}

.future-timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(var(--navy-light), var(--accent));
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  padding-left: var(--gap-sm);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -18px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--navy-light);
  border: 2px solid var(--bg-card);
}

.timeline-period {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--navy-light);
  margin-bottom: 4px;
}

.timeline-item p { font-size: 0.88rem; color: var(--text-2); margin: 0; }

/* Stats card */
.stats-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap-sm);
  margin-top: var(--gap-sm);
}

.stat-big {
  text-align: center;
  padding: var(--gap-sm);
  background: var(--bg);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}

.stat-number {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy-light);
  line-height: 1.1;
}

.stat-desc {
  font-size: 0.78rem;
  color: var(--text-3);
}

/* ─── 11. CONTACT SECTION ─── */
.contact-section {
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-card) 100%);
}

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-xl);
  align-items: start;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: var(--gap-md);
}

.contact-item {
  display: flex;
  gap: var(--gap-md);
  align-items: flex-start;
}

.contact-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.contact-item strong { display: block; font-size: 0.82rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 2px; }
.contact-item span, .contact-item a { font-size: 0.95rem; color: var(--text); }

.note-box {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--gap-lg);
}

.note-box h3 { font-size: 1rem; margin-bottom: var(--gap-sm); }
.note-box p { font-size: 0.9rem; color: var(--text-2); }

.note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: var(--gap-sm);
}

.note-tag {
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 50px;
  color: var(--text-3);
}

/* ─── 12. FOOTER ─── */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.7);
  padding: var(--gap-lg) 0;
  text-align: center;
}

.footer-inner { display: flex; flex-direction: column; gap: 8px; align-items: center; }

.footer-text { font-size: 0.88rem; }

.footer-sub { font-size: 0.82rem; }
.footer-sub a { color: rgba(255,255,255,0.6); }
.footer-sub a:hover { color: white; opacity: 1; }

/* ─── 13. BACK TO TOP ─── */
.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 46px;
  height: 46px;
  background: var(--navy);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(26, 58, 92, 0.35);
  transition: opacity var(--dur), transform var(--dur), background var(--dur);
  z-index: 900;
}

.back-to-top:hover {
  background: var(--navy-mid);
  transform: translateY(-3px);
}

.back-to-top.show { opacity: 1; }
.back-to-top:not(.show) { opacity: 0; pointer-events: none; }

/* ─── 14. ANIMATIONS & SCROLL REVEALS ─── */

/* Initial state for reveal elements */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-32px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal-right {
  opacity: 0;
  transform: translateX(32px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

/* Active state (added by JS) */
.reveal.visible,
.reveal-left.visible,
.reveal-right.visible {
  opacity: 1;
  transform: none;
}

/* Stagger for project cards */
.projects-grid .project-card:nth-child(1) { transition-delay: 0.05s; }
.projects-grid .project-card:nth-child(2) { transition-delay: 0.10s; }
.projects-grid .project-card:nth-child(3) { transition-delay: 0.15s; }
.projects-grid .project-card:nth-child(4) { transition-delay: 0.20s; }
.projects-grid .project-card:nth-child(5) { transition-delay: 0.25s; }
.projects-grid .project-card:nth-child(6) { transition-delay: 0.30s; }

/* ─── 15. DARK MODE EXTRAS ─── */
[data-theme="dark"] .hero-section { }
[data-theme="dark"] .code-block { background: #0a1220; }
[data-theme="dark"] .operator-table thead th { background: #1c2c40; }
[data-theme="dark"] .search-example { background: #0f1a28; }
[data-theme="dark"] .search-example.good { background: rgba(34, 197, 94, 0.06); }
[data-theme="dark"] .prompt-box { background: #0f1a28; }
[data-theme="dark"] .prompt-text { background: #1a2a3e; border-color: #2a3a52; }
[data-theme="dark"] .workflow-step { background: #1a2a3e; }
[data-theme="dark"] .evidence-item { background: #1a2a3e; }
[data-theme="dark"] .naming-rules { background: rgba(232, 160, 32, 0.08); }

/* ─── 16. RESPONSIVE ─── */

/* ── Large tablet (≤ 1024px) ── */
@media (max-width: 1024px) {
  .hero-layout {
    grid-template-columns: 220px 1fr;
    gap: var(--gap-lg);
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .reflection-grid {
    grid-template-columns: 1fr;
  }

  .prompt-comparison {
    grid-template-columns: 1fr;
  }

  .content-showcase {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Tablet portrait (≤ 768px) ── */
@media (max-width: 768px) {
  :root { --gap-2xl: 4rem; }

  /* Nav: hide desktop links, show hamburger */
  .nav-links { display: none; }
  .menu-btn { display: flex; }

  /* Hero: stack vertically */
  .hero-layout {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-avatar-col { order: -1; }
  .avatar-frame { width: 160px; height: 160px; }

  .hero-interests,
  .hero-cta {
    justify-content: center;
  }

  .objectives-grid { justify-content: center; }
  .goals-list li { text-align: left; }

  /* Contact: stack */
  .contact-layout { grid-template-columns: 1fr; gap: var(--gap-lg); }

  /* Evidence & principles */
  .evidence-grid { grid-template-columns: 1fr; }
  .principles-grid { grid-template-columns: 1fr; }
  .content-showcase { grid-template-columns: 1fr; }
}

/* ── Mobile (≤ 480px) ── */
@media (max-width: 480px) {
  :root {
    --gap-md: 1.2rem;
    --gap-lg: 2rem;
    --gap-xl: 3rem;
  }

  h1 { font-size: 2.2rem; }

  .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  .filter-bar { gap: 6px; }
  .filter-btn { padding: 5px 12px; font-size: 0.82rem; }

  .card-number { font-size: 1.8rem; min-width: 42px; }

  .workflow-diagram { gap: 4px; }
  .workflow-step { min-width: 70px; padding: 8px 8px; }
  .wf-icon { font-size: 1rem; }
  .wf-label { font-size: 0.7rem; }
  .wf-tool { font-size: 0.65rem; }
  .wf-arrow { font-size: 0.9rem; }

  .stats-summary { grid-template-columns: 1fr 1fr; }

  .back-to-top { bottom: 18px; right: 18px; width: 40px; height: 40px; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .reveal, .reveal-left, .reveal-right {
    opacity: 1;
    transform: none;
  }
}

/* ─── ADDITIONAL FIXES ─── */

/* Mobile menu max-height animation support */
.mobile-menu {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s ease;
}

.mobile-menu[hidden] {
  display: block !important; /* Keep in DOM for animation */
  max-height: 0 !important;
  visibility: hidden;
  pointer-events: none;
}

/* Project image (when real image is added) */
.project-img {
  width: 100%;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  display: block;
}

/* Avatar real image */
.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Ensure hidden card-body uses display:none for accordion */
.card-body[hidden] { display: none !important; }

/* Focus styles for accordion buttons */
.accordion-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Print styles (basic) */
@media print {
  #navbar, #progress-bar, #back-to-top, .hero-cta, .filter-bar, .card-attachments { display: none; }
  .section { padding: 1rem 0; }
  .project-card { break-inside: avoid; }
  .card-body { display: flex !important; }
  .card-body[hidden] { display: flex !important; }
}
