/* ============================================================
   Hung Luu — portfolio
   ============================================================ */

:root {
  --bg:        #0F0E1A;
  --bg-soft:   #151423;
  --accent:    #00FF99;
  --accent-dim: rgba(0, 255, 153, .12);
  --text:      #FFFFFF;
  --muted:     #BEC1DD;
  --faint:     rgba(255, 255, 255, .62);
  --line:      rgba(255, 255, 255, .10);
  --line-soft: rgba(255, 255, 255, .055);
  --card:      rgba(255, 255, 255, .028);

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --max: 1220px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

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

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
svg { width: 100%; height: 100%; }
em { color: var(--faint); font-style: normal; }
strong { color: var(--text); font-weight: 700; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: 28px; }

/* film grain overlay -------------------------------------- */
.grain {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  opacity: .022;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* scroll reveal — only hidden when JS can bring it back ---- */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .8s var(--ease) var(--d, 0s), transform .8s var(--ease) var(--d, 0s);
}
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .ring-dash { animation: none !important; }
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; gap: 28px;
  padding: 20px 34px;
  transition: background .35s ease, backdrop-filter .35s ease, border-color .35s ease, padding .35s ease;
  border-bottom: 1px solid transparent;
}
.nav.stuck {
  background: rgba(15, 14, 26, .82);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--line-soft);
  padding-block: 14px;
}

.brand { font-weight: 800; font-size: 19px; letter-spacing: -.02em; margin-right: auto; }
.brand .dot { color: var(--accent); }

.nav-links { display: flex; gap: 26px; }
.nav-link {
  position: relative; font-size: 14.5px; color: var(--muted);
  transition: color .25s ease;
}
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: -6px;
  width: 100%; height: 1.5px; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform .35s var(--ease);
}
.nav-link:hover, .nav-link.active { color: var(--accent); }
.nav-link.active::after, .nav-link:hover::after { transform: scaleX(1); }

.nav-cv {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 700; letter-spacing: .04em;
  padding: 9px 16px; border: 1px solid var(--accent); border-radius: 999px;
  color: var(--accent);
  transition: background .3s ease, color .3s ease, transform .3s var(--ease);
}
.nav-cv svg { width: 14px; height: 14px; }
.nav-cv:hover { background: var(--accent); color: #06120C; transform: translateY(-2px); }

.burger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: 0; cursor: pointer; padding: 6px;
}
.burger span {
  display: block; width: 22px; height: 1.8px; background: var(--text);
  transition: transform .3s var(--ease), opacity .3s ease;
}
.burger[aria-expanded="true"] span:first-child { transform: translateY(3.4px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child  { transform: translateY(-3.4px) rotate(-45deg); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 130px 34px 60px;
  overflow: hidden;
}
.hero-glow {
  position: absolute; top: -22%; right: -12%;
  width: 780px; height: 780px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0,255,153,.10) 0%, rgba(0,255,153,.03) 42%, transparent 68%);
  filter: blur(24px);
}
.hero-inner {
  position: relative;
  width: 100%; max-width: var(--max); margin-inline: auto;
  display: grid; grid-template-columns: 1.15fr .85fr;
  gap: 60px; align-items: center;
}

.eyebrow {
  font-size: 14px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 18px;
}
.eyebrow::before {
  content: ""; display: inline-block; vertical-align: middle;
  width: 26px; height: 1px; background: var(--accent); margin-right: 12px;
}

h1 {
  font-size: clamp(2.94rem, 7vw, 4.97rem);
  font-weight: 800; line-height: 1.05; letter-spacing: -.045em;
}
h1 .accent { color: var(--accent); }

.hero-sub {
  margin-top: 26px; max-width: 40ch;
  font-size: 15.5px; line-height: 1.9; color: var(--muted);
}
.hero-loc {
  display: flex; align-items: center; gap: 9px;
  margin-top: 14px; font-size: 14px; color: var(--text);
}
.hero-loc svg { width: 15px; height: 15px; flex-shrink: 0; }
.hero-loc .loc-icon { font-size: 16px; line-height: 1; flex-shrink: 0; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 14.5px; font-weight: 700; letter-spacing: .05em;
  padding: 14px 26px; border-radius: 999px;
  border: 1px solid transparent;
  transition: transform .3s var(--ease), background .3s ease, color .3s ease,
              border-color .3s ease, box-shadow .3s ease;
}
.btn svg { width: 16px; height: 16px; transition: transform .3s var(--ease); }
.btn:hover svg { transform: translateX(4px); }
.btn-primary { background: var(--accent); color: #06120C; }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 12px 34px -10px rgba(0,255,153,.5); }
.btn-ghost { border-color: var(--line); color: var(--muted); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); }

/* socials ------------------------------------------------- */
.socials { display: flex; gap: 12px; margin-top: 34px; list-style: none; }
.socials a {
  position: relative;
  display: grid; place-items: center;
  width: 40px; height: 40px; padding: 11px;
  border: 1px solid var(--line); border-radius: 50%;
  color: var(--muted);
  transition: color .3s ease, border-color .3s ease, transform .3s var(--ease), background .3s ease;
}
.socials a:hover {
  color: var(--accent); border-color: var(--accent);
  background: var(--accent-dim); transform: translateY(-4px);
}
.socials a::after {
  content: attr(data-tip);
  position: absolute; bottom: -30px; left: 50%; translate: -50% 0;
  font-size: 12px; letter-spacing: .06em; white-space: nowrap;
  color: var(--faint); opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
.socials a:hover::after { opacity: 1; }

/* photo --------------------------------------------------- */
/* .hero-photo is the RING's box; the photo is inset inside it so the
   dashed circle orbits with a clear gap instead of sitting on the rim */
.hero-photo { position: relative; justify-self: center; width: min(470px, 86vw); aspect-ratio: 1; }
.ring { position: absolute; inset: 0; }
.ring-dash {
  transform-origin: 150px 150px;
  animation: spin 26s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.photo-mask {
  position: absolute; inset: 5%;
  border-radius: 50%; overflow: hidden;
  background: var(--bg-soft);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07), 0 26px 70px -24px rgba(0,0,0,.85);
}
.photo-mask img {
  width: 100%; height: 100%;
  object-fit: cover;              /* source is pre-cropped square, centred on the face */
  filter: saturate(1.02) contrast(1.03);
  transition: transform 1.1s var(--ease);
}
.hero-photo:hover .photo-mask img { transform: scale(1.045); }

.badge {
  position: absolute; bottom: 11%; left: -3%;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: .04em;
  padding: 9px 16px; border-radius: 999px;
  background: var(--bg-soft); border: 1px solid var(--line);
  box-shadow: 0 10px 30px -12px rgba(0,0,0,.9);
}
.badge::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px var(--accent-dim);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 8px transparent; } }

.scroll-hint {
  position: relative;
  margin-top: 64px; text-align: center;
  font-size: 12.5px; letter-spacing: .28em; color: var(--faint);
}

/* ============================================================
   STATS
   ============================================================ */
.stats { border-block: 1px solid var(--line-soft); }
.stats-grid {
  max-width: var(--max); margin-inline: auto;
  display: grid; grid-template-columns: repeat(4, 1fr);
}
.stat {
  padding: 46px 28px; text-align: center;
  border-left: 1px solid var(--line-soft);
}
.stat:first-child { border-left: 0; }
.num {
  display: block;
  font-size: clamp(2.26rem, 4.5vw, 3.28rem); font-weight: 800;
  letter-spacing: -.04em; color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.label { font-size: 13px; letter-spacing: .1em; color: var(--faint); }

/* ============================================================
   SECTION SHELL
   ============================================================ */
.section { padding: 118px 0; }
.section.tight { padding-top: 0; }

.sec-head { max-width: 52ch; margin-bottom: 62px; }
.sec-kicker {
  display: block; margin-bottom: 16px;
  font-size: 13px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--accent);
}
.sec-head h2, .contact-box h2 {
  font-size: clamp(1.69rem, 3.6vw, 2.54rem);
  font-weight: 700; line-height: 1.35; letter-spacing: -.035em;
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-grid { display: grid; grid-template-columns: 1.25fr .9fr; gap: 58px; }
.about-copy p { color: var(--muted); margin-bottom: 20px; max-width: 58ch; }

/* language tabs — switch the profile copy ------------------ */
.lang-tabs { display: flex; flex-wrap: wrap; gap: 10px 8px; margin-bottom: 26px; }
.lang-tab {
  font-family: inherit; font-size: 13px; letter-spacing: .06em;
  padding: 5px 12px; border-radius: 999px; cursor: pointer;
  background: none; border: 1px solid var(--line-soft); color: var(--faint);
  transition: color .25s ease, border-color .25s ease, background .25s ease;
}
.lang-tab:hover { color: var(--text); border-color: var(--line); }
.lang-tab.on {
  border-color: var(--accent); color: var(--accent); background: var(--accent-dim);
}
.lang-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* without JS the tabs can't switch anything, so hide them and
   let every translation stand on the page */
html:not(.js) .lang-tabs { display: none; }
html:not(.js) .i18n[hidden] { display: revert; }

blockquote {
  margin-top: 30px; padding-left: 20px;
  border-left: 2px solid var(--accent);
  font-size: 17px; font-weight: 500; color: var(--text);
}

.about-side { display: grid; gap: 16px; align-content: start; }
.card {
  padding: 26px 24px;
  background: var(--card); border: 1px solid var(--line-soft); border-radius: 16px;
  transition: border-color .35s ease, transform .35s var(--ease);
}
.card:hover { border-color: var(--line); transform: translateY(-3px); }
.card h3 {
  font-size: 13px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--faint); font-weight: 500; margin-bottom: 18px;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.chips li {
  font-size: 13px; padding: 6px 12px; border-radius: 7px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line-soft);
  color: var(--muted);
  transition: color .25s ease, border-color .25s ease;
}
.chips li:hover { color: var(--accent); border-color: var(--accent); }

.list { list-style: none; display: grid; gap: 13px; }
.list li {
  position: relative; padding-left: 18px;
  font-size: 14px; line-height: 1.65; color: var(--muted);
}
.list li::before {
  content: ""; position: absolute; left: 0; top: 8px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
}
.list.lang li { display: flex; justify-content: space-between; gap: 14px; }
.list.lang em { font-size: 12.5px; color: var(--faint); }

/* ============================================================
   EDUCATION
   ============================================================ */
.edu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.edu {
  padding: 30px 26px 26px;
  background: var(--card); border: 1px solid var(--line-soft); border-radius: 16px;
  transition: border-color .35s ease, transform .35s var(--ease), background .35s ease;
}
.edu:hover { border-color: var(--accent); transform: translateY(-4px); background: rgba(0,255,153,.03); }
.edu .years {
  display: inline-block; margin-bottom: 14px;
  font-size: 12.5px; letter-spacing: .1em; color: var(--accent);
}
.edu h3 { font-size: 18px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 8px; }
.edu p { font-size: 14px; line-height: 1.7; color: var(--muted); margin-bottom: 12px; }
.edu .place { font-size: 12.5px; letter-spacing: .08em; color: var(--faint); }

/* ============================================================
   WORK
   ============================================================ */
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.work {
  position: relative; overflow: hidden;
  padding: 30px 28px 28px;
  background: var(--card); border: 1px solid var(--line-soft); border-radius: 18px;
  transition: border-color .4s ease, transform .4s var(--ease);
}
.work::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(520px circle at 100% 0%, rgba(0,255,153,.07), transparent 62%);
  opacity: 0; transition: opacity .45s ease;
}
.work:hover { border-color: rgba(0,255,153,.34); transform: translateY(-5px); }
.work:hover::before { opacity: 1; }

.work-top {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.work-idx {
  font-size: 12.5px; letter-spacing: .16em; color: var(--faint);
}
.work-tag {
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px;
  background: var(--accent-dim); color: var(--accent);
}
.work-link {
  display: grid; place-items: center;
  width: 34px; height: 34px; padding: 9px;
  border: 1px solid var(--line); border-radius: 50%; color: var(--muted);
  transition: all .3s var(--ease);
}
.work-link:hover { background: var(--accent); border-color: var(--accent); color: #06120C; rotate: 45deg; }

.work h3 {
  position: relative;
  font-size: 21.5px; font-weight: 700; letter-spacing: -.03em; margin-bottom: 12px;
}
.work p {
  position: relative;
  font-size: 14px; line-height: 1.8; color: var(--muted); margin-bottom: 20px;
}
.tags { position: relative; display: flex; flex-wrap: wrap; gap: 7px; list-style: none; }
.tags li {
  font-size: 12px; letter-spacing: .05em;
  padding: 5px 10px; border-radius: 6px;
  border: 1px solid var(--line-soft); color: var(--faint);
}

/* ============================================================
   EXPERIENCE
   ============================================================ */
.exp-list { list-style: none; }
.exp {
  display: grid; grid-template-columns: 190px 1fr; gap: 34px;
  padding: 30px 0;
  border-top: 1px solid var(--line-soft);
  transition: background .35s ease;
}
.exp:last-child { border-bottom: 1px solid var(--line-soft); }
.exp:hover .exp-what h3 { color: var(--accent); }

.exp-when {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline;
  font-size: 13px; letter-spacing: .06em; color: var(--faint);
  padding-top: 4px;
}
.exp-when .sep { opacity: .4; }
.exp-when .now { color: var(--accent); }

.exp-what h3 {
  font-size: 19px; font-weight: 700; letter-spacing: -.025em;
  margin-bottom: 5px; transition: color .3s ease;
}
.exp-what .org { font-size: 14px; color: var(--accent); margin-bottom: 10px; }
.exp-what .org .loc { color: var(--faint); }
.exp-what .desc { font-size: 14px; line-height: 1.85; color: var(--muted); max-width: 68ch; }

/* ============================================================
   JOURNEY
   ============================================================ */
.timeline {
  position: relative;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 40px;
}
.timeline::before {
  content: ""; position: absolute; left: 50%; top: 6px; bottom: 6px;
  width: 1px; background: linear-gradient(180deg, transparent, var(--line), transparent);
}
.tl {
  position: relative;
  padding: 22px 24px;
  background: var(--card); border: 1px solid var(--line-soft); border-radius: 14px;
  transition: border-color .35s ease, transform .35s var(--ease);
}
.tl:hover { border-color: var(--accent); transform: translateY(-3px); }
.tl h3 {
  font-size: 13.5px; letter-spacing: .12em; color: var(--accent);
  font-weight: 700; margin-bottom: 8px;
}
.tl p { font-size: 14px; line-height: 1.75; color: var(--muted); }

/* ============================================================
   CONTACT + FOOTER
   ============================================================ */
.contact { padding-bottom: 90px; }
.contact-box {
  position: relative; overflow: hidden;
  padding: 66px 48px;
  text-align: center;
  background:
    radial-gradient(620px circle at 50% 0%, rgba(0,255,153,.10), transparent 66%),
    var(--card);
  border: 1px solid var(--line-soft); border-radius: 26px;
}
.contact-box .sec-kicker { margin-bottom: 14px; }
.contact-box h2 { margin-bottom: 16px; }
.contact-box > p {
  max-width: 48ch; margin: 0 auto 34px;
  font-size: 14.5px; line-height: 1.85; color: var(--muted);
}
.contact-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }

.footer { border-top: 1px solid var(--line-soft); }
.footer-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding-block: 28px;
  font-size: 13px; letter-spacing: .06em; color: var(--faint);
}
.to-top { transition: color .3s ease; }
.to-top:hover { color: var(--accent); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; gap: 52px; }
  .hero-copy { order: 2; }
  .hero-photo { order: 1; justify-self: start; width: min(336px, 78vw); }
  .badge { left: auto; right: -4%; bottom: 4%; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .edu-grid, .work-grid { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: 1fr; }
  .timeline::before { left: 0; }
  .tl { margin-left: 20px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
}

@media (max-width: 768px) {
  /* tight gap + shrinkable brand so the bar still fits before the
     webfont lands and the wider fallback mono is in use */
  .nav { padding: 16px 22px; gap: 14px; }
  .brand { font-size: 17px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-links {
    position: fixed; inset: 0 0 auto; top: 0;
    flex-direction: column; gap: 4px;
    padding: 84px 26px 30px;
    background: rgba(15, 14, 26, .97);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line-soft);
    transform: translateY(-100%);
    transition: transform .45s var(--ease);
  }
  .nav-links.open { transform: none; }
  .nav-link { font-size: 18px; padding: 12px 0; }
  .nav-link::after { display: none; }
  .burger { display: flex; }
  .nav-cv { padding: 8px 13px; font-size: 13px; }

  .hero { padding: 112px 22px 50px; min-height: auto; }
  .section { padding: 84px 0; }
  .wrap { padding-inline: 22px; }
  .exp { grid-template-columns: 1fr; gap: 12px; }
  .contact-box { padding: 46px 24px; border-radius: 20px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .scroll-hint { margin-top: 44px; }
}

@media (max-width: 440px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat { border-left: 0; padding-block: 32px; }
  .stat + .stat { border-top: 1px solid var(--line-soft); }
  .btn { width: 100%; justify-content: center; }
}
