/* =====================================================================
   Hữu Hùng — SEO & AI Automation Specialist
   Dark + Neon AI design system (shared by CV + Portfolio)
   ===================================================================== */

:root {
  /* Base */
  --bg: #07080d;
  --bg-2: #0b0d16;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-2: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(139, 92, 246, 0.5);

  /* Text */
  --text: #eef0f6;
  --text-muted: #9aa0b4;
  --text-dim: #6b7186;

  /* Neon accents */
  --violet: #8b5cf6;
  --violet-2: #a855f7;
  --cyan: #22d3ee;
  --cyan-2: #06b6d4;
  --pink: #f472b6;
  --green: #34d399;

  --grad: linear-gradient(120deg, #8b5cf6 0%, #22d3ee 100%);
  --grad-soft: linear-gradient(120deg, rgba(139,92,246,.18), rgba(34,211,238,.18));
  --grad-text: linear-gradient(120deg, #c4b5fd 0%, #67e8f9 100%);

  --glow-violet: 0 0 0 1px rgba(139,92,246,.4), 0 8px 40px -8px rgba(139,92,246,.55);
  --glow-cyan: 0 0 0 1px rgba(34,211,238,.4), 0 8px 40px -8px rgba(34,211,238,.45);

  --radius: 18px;
  --radius-sm: 12px;
  --maxw: 1120px;

  --font-sans: 'Be Vietnam Pro', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-head: 'Be Vietnam Pro', var(--font-sans);
  --font-mono: ui-monospace, 'Cascadia Code', SFMono-Regular, Menlo, Consolas, monospace;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Animated background ---------- */
.bg-mesh {
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(40% 35% at 15% 10%, rgba(139,92,246,.22), transparent 60%),
    radial-gradient(35% 40% at 85% 15%, rgba(34,211,238,.18), transparent 60%),
    radial-gradient(45% 45% at 70% 90%, rgba(168,85,247,.16), transparent 60%),
    var(--bg);
}
.bg-grid {
  position: fixed; inset: 0; z-index: -2; opacity: .35;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 54px 54px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
}
#particles { position: fixed; inset: 0; z-index: -1; pointer-events: none; }

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
section { padding: 80px 0; position: relative; }
.section-head { margin-bottom: 44px; }
.eyebrow {
  font-family: var(--font-mono); font-size: .8rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--cyan);
  display: inline-flex; align-items: center; gap: 8px;
}
.eyebrow::before { content: ''; width: 26px; height: 1px; background: var(--cyan); display: inline-block; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; font-weight: 700; }
.h-section { font-size: clamp(1.8rem, 4vw, 2.7rem); margin-top: 10px; letter-spacing: -.02em; }
.grad-text {
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.muted { color: var(--text-muted); }

/* ---------- Navbar ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: rgba(7,8,13,.55); border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.nav.scrolled { border-bottom-color: var(--border); background: rgba(7,8,13,.8); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; color: var(--text); text-decoration: none; }
.brand .dot { width: 30px; height: 30px; border-radius: 9px; background: var(--grad); display: grid; place-items: center; font-size: .85rem; color: #07080d; box-shadow: var(--glow-violet); }
.brand small { color: var(--text-dim); font-family: var(--font-mono); font-size: .72rem; font-weight: 500; }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-size: .92rem; padding: 8px 14px; border-radius: 10px; transition: .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--surface-2); }
.nav-tools { display: flex; align-items: center; gap: 10px; }

.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; font-family: var(--font-mono); font-size: .76rem; }
.lang-switch button { background: transparent; color: var(--text-dim); border: 0; padding: 6px 12px; cursor: pointer; transition: .2s; }
.lang-switch button.active { background: var(--grad); color: #07080d; font-weight: 700; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 999px; font-weight: 600; font-size: .92rem; text-decoration: none; cursor: pointer; border: 1px solid var(--border); color: var(--text); background: var(--surface-2); transition: .25s; }
.btn:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.btn-primary { background: var(--grad); color: #07080d; border: 0; box-shadow: var(--glow-violet); }
.btn-primary:hover { box-shadow: 0 0 0 1px rgba(139,92,246,.6), 0 12px 50px -8px rgba(139,92,246,.7); }
.btn-ghost { background: transparent; }

.menu-toggle { display: none; background: transparent; border: 1px solid var(--border); color: var(--text); width: 40px; height: 40px; border-radius: 10px; cursor: pointer; font-size: 1.2rem; }

/* ---------- Hero ---------- */
.hero { padding-top: 130px; padding-bottom: 60px; }
.hero-grid { display: grid; grid-template-columns: 1.35fr .85fr; gap: 50px; align-items: center; }
.badge-live { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: .78rem; color: var(--green); background: rgba(52,211,153,.08); border: 1px solid rgba(52,211,153,.25); padding: 6px 14px; border-radius: 999px; }
.badge-live .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(52,211,153,.7); animation: pulse 2s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(52,211,153,.6);} 70%{box-shadow:0 0 0 9px rgba(52,211,153,0);} 100%{box-shadow:0 0 0 0 rgba(52,211,153,0);} }

.hero h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); letter-spacing: -.03em; margin: 18px 0 6px; }
.hero .role { font-family: var(--font-mono); font-size: clamp(1rem, 2.4vw, 1.35rem); color: var(--text); min-height: 1.6em; }
.hero .role .cursor { color: var(--cyan); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero p.lead { color: var(--text-muted); font-size: 1.05rem; max-width: 540px; margin: 20px 0 28px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-photo { position: relative; justify-self: center; }
.hero-photo .frame {
  width: 290px; height: 360px; border-radius: 24px; overflow: hidden;
  border: 1px solid var(--border); background: var(--surface);
  box-shadow: 0 30px 80px -20px rgba(139,92,246,.45);
}
.hero-photo .frame img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.hero-photo::before { content: ''; position: absolute; inset: -2px; border-radius: 26px; background: var(--grad); filter: blur(26px); opacity: .35; z-index: -1; }
.hero-photo .chip { position: absolute; backdrop-filter: blur(10px); background: rgba(11,13,22,.8); border: 1px solid var(--border); border-radius: 14px; padding: 10px 14px; font-size: .82rem; box-shadow: 0 10px 30px -10px rgba(0,0,0,.6); }
.hero-photo .chip b { display:block; font-family: var(--font-head); font-size: 1.15rem; }
.hero-photo .chip .grad-text { font-size: 1.2rem; }
.hero-photo .chip-1 { top: 26px; left: -38px; }
.hero-photo .chip-2 { bottom: 30px; right: -34px; }

/* ---------- Stat strip ---------- */
.stats-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 54px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; transition: .3s; }
.stat-card:hover { border-color: var(--border-hover); transform: translateY(-4px); box-shadow: var(--glow-violet); }
.stat-num { font-family: var(--font-head); font-size: clamp(1.7rem, 4vw, 2.5rem); font-weight: 700; }
.stat-label { color: var(--text-muted); font-size: .88rem; margin-top: 4px; }

/* ---------- Cards / grids ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; transition: .3s; position: relative; overflow: hidden; }
.card:hover { border-color: var(--border-hover); transform: translateY(-4px); }
.card::after { content:''; position:absolute; inset:0; background: var(--grad-soft); opacity:0; transition:.3s; z-index:-1; }
.card:hover::after { opacity:1; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.info-list { list-style: none; display: grid; gap: 14px; }
.info-list li { display: flex; gap: 12px; align-items: flex-start; }
.info-list .ic { flex: 0 0 38px; height: 38px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; font-size: 1rem; }
.info-list span.k { color: var(--text-dim); font-size: .8rem; display: block; }
.info-list a { color: var(--text); text-decoration: none; }
.info-list a:hover { color: var(--cyan); }

/* ---------- Skills ---------- */
.skill-block h3 { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; margin-bottom: 16px; }
.skill-block h3 .ic { width: 34px; height: 34px; border-radius: 10px; background: var(--grad-soft); border: 1px solid var(--border); display: grid; place-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip-tag { font-size: .85rem; padding: 7px 13px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); transition: .2s; }
.chip-tag:hover { color: var(--text); border-color: var(--border-hover); }
.bar { margin-bottom: 14px; }
.bar .bar-head { display: flex; justify-content: space-between; font-size: .88rem; margin-bottom: 6px; }
.bar .track { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar .fill { height: 100%; border-radius: 999px; background: var(--grad); width: 0; transition: width 1.3s cubic-bezier(.2,.8,.2,1); }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 30px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--violet), var(--cyan)); opacity: .5; }
.tl-item { position: relative; padding-bottom: 34px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ''; position: absolute; left: -30px; top: 5px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 2px solid var(--violet); box-shadow: 0 0 0 4px rgba(139,92,246,.15); }
.tl-item.cur::before { background: var(--grad); border-color: transparent; box-shadow: 0 0 14px rgba(139,92,246,.8); }
.tl-time { font-family: var(--font-mono); font-size: .8rem; color: var(--cyan); }
.tl-item h3 { font-size: 1.2rem; margin: 4px 0 2px; }
.tl-org { color: var(--text-muted); font-size: .92rem; margin-bottom: 10px; }
.tl-list { list-style: none; display: grid; gap: 7px; }
.tl-list li { position: relative; padding-left: 20px; color: var(--text-muted); font-size: .94rem; }
.tl-list li::before { content: '▹'; position: absolute; left: 0; color: var(--cyan); }
.tl-list li b { color: var(--text); }

/* ---------- Project cards (portfolio) ---------- */
.proj { display: flex; flex-direction: column; height: 100%; }
.proj .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.tag { display: inline-block; font-family: var(--font-mono); font-size: .72rem; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); color: var(--cyan); white-space: nowrap; }
.proj h3 { font-size: 1.25rem; margin: 6px 0; }
.proj .url { font-family: var(--font-mono); font-size: .82rem; color: var(--text-dim); }
.proj p { color: var(--text-muted); font-size: .93rem; margin: 12px 0; flex: 1; }
.metrics { display: flex; flex-wrap: wrap; gap: 16px; margin-top: auto; padding-top: 14px; border-top: 1px dashed var(--border); }
.metric .v { font-family: var(--font-head); font-size: 1.4rem; font-weight: 700; }
.metric .l { font-size: .76rem; color: var(--text-dim); }

.feature { display: grid; grid-template-columns: 1.1fr .9fr; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.feature .left { padding: 36px; }
.feature .right { background: var(--grad-soft); padding: 36px; display: grid; align-content: center; gap: 18px; border-left: 1px solid var(--border); }
.feature .big-metric .v { font-family: var(--font-head); font-size: clamp(2.2rem,5vw,3.4rem); font-weight: 700; line-height: 1; }
.feature .big-metric .l { color: var(--text-muted); margin-top: 6px; }
.feature .left { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.feature .left .tag { margin-bottom: 16px; }
.feature .left p { margin-bottom: 14px; }
.feature .left .tl-list { align-self: stretch; }

/* AI workflow steps */
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 18px 0; }
.flow .node { font-family: var(--font-mono); font-size: .82rem; padding: 8px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.flow .arrow { color: var(--cyan); }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 12px; }
.tool { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: .9rem; transition: .2s; }
.tool:hover { border-color: var(--border-hover); transform: translateY(-3px); }
.tool .ic { width: 30px; height: 30px; border-radius: 8px; background: var(--grad-soft); display: grid; place-items: center; font-size: .9rem; }

.site-pill { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: .85rem; color: var(--text-muted); transition: .2s; }
.site-pill:hover { color: var(--text); border-color: var(--border-hover); }
.site-pill .ic { color: var(--cyan); }

.building { border: 1px dashed rgba(34,211,238,.4); background: rgba(34,211,238,.04); }
.building .tag { color: var(--green); border-color: rgba(52,211,153,.4); }

/* ---------- CTA / contact ---------- */
.cta { text-align: center; border: 1px solid var(--border); border-radius: 26px; padding: 60px 30px; background:
  radial-gradient(60% 100% at 50% 0%, rgba(139,92,246,.16), transparent 70%), var(--surface); }
.cta h2 { font-size: clamp(1.8rem,4vw,2.6rem); }
.contact-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 26px; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--border); padding: 40px 0; color: var(--text-dim); font-size: .88rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: center; }
.ref-box { font-size: .85rem; color: var(--text-muted); }
.ref-box b { color: var(--text); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s, transform .7s; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- i18n visibility ---------- */
[data-lang-hide] { display: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-photo { order: -1; }
  .about-grid, .feature { grid-template-columns: 1fr; }
  .feature .right { border-left: 0; border-top: 1px solid var(--border); }
  .stats-strip, .grid-4 { grid-template-columns: repeat(2,1fr); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  section { padding: 60px 0; }
  .nav-links { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; background: rgba(7,8,13,.97); padding: 14px; border-bottom: 1px solid var(--border); }
  .nav-links.open { display: flex; }
  .nav-links a { width: 100%; }
  .menu-toggle { display: block; }
  .hero-photo .chip-1 { left: 0; }
  .hero-photo .chip-2 { right: 0; }
  .stats-strip { grid-template-columns: 1fr 1fr; }
  .feature .left, .feature .right { padding: 24px; }
  .feature .big-metric .v { font-size: 1.9rem; }
  .metrics { gap: 12px; }
  .metric .v { font-size: 1.2rem; }
  .h-section { font-size: 1.6rem; }
  .grid-4 { grid-template-columns: 1fr; }
  .nav-tools { gap: 6px; }
  .brand small { display: none; }
  .container { padding: 0 16px; }
}

/* ---------- Print (CV → PDF) ---------- */
@media print {
  .nav, #particles, .bg-grid, .hero-cta, .menu-toggle, .lang-switch, .cta .contact-row, .scroll-top { display: none !important; }
  body { background: #fff; color: #111; }
  .bg-mesh { display: none; }
  .grad-text { -webkit-text-fill-color: #6d28d9; color: #6d28d9; }
  section { padding: 18px 0; }
  .card, .stat-card { break-inside: avoid; border-color: #ddd; }
}
