/* =========================================================
   Phạm Văn Đức — Personal brand site
   Mobile-first · không framework · biến màu ở :root
   ========================================================= */
:root {
  --bg: #070b1a;
  --bg-2: #0a1024;
  --surface: #0e1630;
  --surface-2: #121c3b;
  --line: rgba(148, 163, 184, .14);
  --line-strong: rgba(148, 163, 184, .26);
  --text: #f5f7fb;
  --soft: #a3b0c6;
  --muted: #73819b;
  --accent: #22d3ee;      /* cyan */
  --accent-2: #3b82f6;    /* electric blue */
  --accent-glow: rgba(34, 211, 238, .35);
  --grad: linear-gradient(120deg, #22d3ee 0%, #3b82f6 60%, #6366f1 100%);
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 20px 50px -24px rgba(0,0,0,.7);
  --header-h: 68px;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1240px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: clamp(15px, .2vw + 14.4px, 17px); line-height: 1.7;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.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; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--accent); color: #04121a; padding: 10px 16px; border-radius: 10px; font-weight: 600; }
.skip:focus { top: 12px; }

.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
section { position: relative; padding-block: clamp(72px, 10vw, 140px); }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -.02em; font-weight: 700; }
h2 { font-size: clamp(30px, 4.4vw, 56px); }
h3 { font-size: clamp(19px, 1.4vw, 23px); letter-spacing: -.01em; }
p { margin: 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: currentColor; }
.lead { color: var(--soft); font-size: clamp(16px, 1.1vw + 10px, 20px); max-width: 60ch; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.section-head { display: grid; gap: 18px; margin-bottom: clamp(40px, 6vw, 72px); max-width: 780px; }

/* ---------- Buttons ---------- */
.btn {
  --mx: 0px; --my: 0px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; font-weight: 600; font-size: 15px;
  border: 1px solid var(--line-strong); background: rgba(255,255,255,.03); cursor: pointer;
  transform: translate(var(--mx), var(--my));
  transition: transform .35s var(--ease), background .25s, border-color .25s, box-shadow .25s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent); background: rgba(34,211,238,.08); }
.btn-primary { background: var(--grad); border: 0; color: #031019; box-shadow: 0 10px 30px -10px var(--accent-glow); }
.btn-primary:hover { background: var(--grad); box-shadow: 0 14px 40px -8px var(--accent-glow); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-sm { min-height: 42px; padding: 0 18px; font-size: 14px; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h);
  transition: background .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled { background: rgba(7, 11, 26, .78); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); border-color: var(--line); }
.nav { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: -.01em; }
.brand img { width: 40px; height: 32px; object-fit: contain; }
.brand small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); letter-spacing: .02em; line-height: 1.2; }
.brand span { line-height: 1.2; }
.nav-links { display: none; }
.nav-links a { position: relative; padding: 8px 2px; color: var(--soft); font-size: 15px; transition: color .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px; border-radius: 2px; background: var(--grad); }
.nav-cta { display: none; }
.menu-btn {
  width: 48px; height: 48px; border-radius: 14px; border: 1px solid var(--line-strong); background: rgba(255,255,255,.03);
  display: grid; place-items: center; cursor: pointer;
}
.menu-btn span, .menu-btn span::before, .menu-btn span::after { display: block; width: 20px; height: 2px; background: var(--text); border-radius: 2px; position: relative; transition: transform .3s var(--ease), background .2s; }
.menu-btn span::before, .menu-btn span::after { content: ""; position: absolute; left: 0; }
.menu-btn span::before { top: -6px; } .menu-btn span::after { top: 6px; }
.menu-open .menu-btn span { background: transparent; }
.menu-open .menu-btn span::before { transform: translateY(6px) rotate(45deg); }
.menu-open .menu-btn span::after { transform: translateY(-6px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 49; padding: calc(var(--header-h) + 24px) var(--gutter) 32px;
  background: rgba(7, 11, 26, .97); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  display: flex; flex-direction: column; gap: 6px; overflow-y: auto;
  opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
}
.menu-open .mobile-menu { opacity: 1; visibility: visible; }
.mobile-menu a.m-link {
  display: flex; justify-content: space-between; align-items: center; padding: 16px 4px; font-size: clamp(22px, 6vw, 30px); font-weight: 600;
  border-bottom: 1px solid var(--line); transform: translateY(12px); opacity: 0; transition: transform .45s var(--ease), opacity .45s;
}
.mobile-menu a.m-link small { font-size: 13px; color: var(--muted); font-weight: 500; }
.menu-open .mobile-menu a.m-link { transform: none; opacity: 1; }
.menu-open .mobile-menu a.m-link:nth-child(2) { transition-delay: .04s; } .menu-open .mobile-menu a.m-link:nth-child(3) { transition-delay: .08s; }
.menu-open .mobile-menu a.m-link:nth-child(4) { transition-delay: .12s; } .menu-open .mobile-menu a.m-link:nth-child(5) { transition-delay: .16s; }
.menu-open .mobile-menu a.m-link:nth-child(6) { transition-delay: .2s; }
.mobile-menu .btn { margin-top: 24px; }
.menu-open { overflow: hidden; }

/* ---------- Hero ---------- */
.hero { min-height: 100svh; display: flex; align-items: center; padding-top: calc(var(--header-h) + 40px); padding-bottom: 64px; overflow: hidden; isolation: isolate; }
.hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero-grid {
  position: absolute; inset: -1px;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
  opacity: .55;
}
.aurora { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; will-change: transform; }
.aurora.a1 { width: 46vmax; height: 46vmax; left: -12vmax; top: -16vmax; background: radial-gradient(circle, rgba(59,130,246,.55), transparent 65%); animation: drift1 18s ease-in-out infinite alternate; }
.aurora.a2 { width: 40vmax; height: 40vmax; right: -14vmax; bottom: -18vmax; background: radial-gradient(circle, rgba(34,211,238,.42), transparent 65%); animation: drift2 22s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(8vmax, 6vmax) scale(1.08); } }
@keyframes drift2 { to { transform: translate(-6vmax, -8vmax) scale(1.1); } }
#bubbles { position: absolute; inset: 0; width: 100%; height: 100%; }

.hero-inner { display: grid; gap: 48px; align-items: center; }
.hero-copy { display: grid; gap: 26px; }
.hero-title { font-size: clamp(40px, 7.4vw, 92px); line-height: 1.02; letter-spacing: -.035em; }
.hero-title .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero-title .line > span { display: inline-block; transform: translateY(105%); animation: lineUp .9s var(--ease) forwards; }
.hero-title .line:nth-child(2) > span { animation-delay: .12s; }
.hero-title .line:nth-child(3) > span { animation-delay: .24s; }
@keyframes lineUp { to { transform: none; } }
.hero-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.hero-name strong { font-size: clamp(20px, 2vw, 26px); font-weight: 700; }
.hero-name span { color: var(--soft); font-size: 15px; }
.hero .lead { max-width: 52ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.fade-up { opacity: 0; transform: translateY(16px); animation: fadeUp .9s var(--ease) forwards; }
.d1 { animation-delay: .35s; } .d2 { animation-delay: .5s; } .d3 { animation-delay: .65s; } .d4 { animation-delay: .8s; }
@keyframes fadeUp { to { opacity: 1; transform: none; } }

.hero-visual { position: relative; justify-self: center; width: min(100%, 460px); aspect-ratio: 4 / 5; opacity: 0; animation: fadeIn 1.4s .3s var(--ease) forwards; }
@keyframes fadeIn { to { opacity: 1; } }
.portrait-frame {
  position: absolute; inset: 0; border-radius: 32px; overflow: hidden; border: 1px solid var(--line-strong);
  box-shadow: 0 40px 100px -40px rgba(34,211,238,.35), var(--shadow); background: var(--surface);
}
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); }
.portrait-frame::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(7,11,26,.85) 100%); }
.portrait-ring { position: absolute; inset: -14px; border-radius: 40px; border: 1px solid rgba(34,211,238,.25); pointer-events: none; }
.float-card {
  position: absolute; z-index: 2; padding: 14px 16px; border-radius: 16px;
  background: rgba(14, 22, 48, .78); border: 1px solid var(--line-strong); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow); font-size: 13px; color: var(--soft); line-height: 1.4;
}
.float-card b { display: block; color: var(--text); font-size: 20px; letter-spacing: -.01em; }
.float-card.fc1 { left: -10px; top: 12%; }
.float-card.fc2 { right: -10px; bottom: 22%; }
.portrait-caption { position: absolute; left: 22px; right: 22px; bottom: 20px; z-index: 2; }
.portrait-caption b { font-size: 18px; display: block; }
.portrait-caption span { color: var(--soft); font-size: 14px; }
.scroll-hint { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); display: none; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; }
.scroll-hint i { width: 1px; height: 36px; background: linear-gradient(var(--accent), transparent); animation: hint 2s ease-in-out infinite; }
@keyframes hint { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ---------- Stats strip ---------- */
.stats { padding-block: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg-2); }
.stat { padding: 26px 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat:nth-child(2n) { border-right: 0; }
.stat:nth-last-child(-n+2) { border-bottom: 0; }
.stat b { display: block; font-size: clamp(28px, 4vw, 44px); letter-spacing: -.03em; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat span { color: var(--soft); font-size: 14px; }

/* ---------- About (editorial) ---------- */
.about-grid { display: grid; gap: 48px; }
.about-media { position: relative; display: grid; gap: 16px; }
.reveal-img { position: relative; overflow: hidden; border-radius: var(--radius); clip-path: inset(100% 0 0 0 round var(--radius)); transition: clip-path 1.2s var(--ease); }
.reveal-img.in { clip-path: inset(0 0 0 0 round var(--radius)); }
.reveal-img img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.15); transition: transform 1.6s var(--ease); }
.reveal-img.in img { transform: scale(1); }
.about-media .m1 { aspect-ratio: 4 / 5; }
.about-media .m2 { aspect-ratio: 1; width: 62%; margin-left: auto; margin-top: -26%; border: 6px solid var(--bg); }
.story { display: grid; gap: 40px; }
.story-block { display: grid; gap: 12px; padding-left: 22px; border-left: 1px solid var(--line); }
.story-block h3 { display: flex; gap: 12px; align-items: baseline; }
.story-block h3 em { font-style: normal; font-size: 13px; color: var(--accent); font-weight: 600; letter-spacing: .1em; }
.story-block p { color: var(--soft); }
.manifesto {
  margin-top: clamp(56px, 8vw, 100px); padding: clamp(28px, 5vw, 64px); border-radius: 28px; position: relative; overflow: hidden;
  background: radial-gradient(120% 140% at 0% 0%, rgba(59,130,246,.18), transparent 50%), radial-gradient(120% 140% at 100% 100%, rgba(34,211,238,.14), transparent 50%), var(--surface);
  border: 1px solid var(--line);
}
.manifesto blockquote { margin: 0; font-size: clamp(24px, 3.6vw, 46px); line-height: 1.2; letter-spacing: -.02em; font-weight: 600; max-width: 22ch; }
.manifesto figcaption { margin-top: 22px; color: var(--soft); font-size: 15px; }
.values { display: grid; gap: 14px; margin-top: 28px; }
.value { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: var(--radius-sm); background: rgba(255,255,255,.02); border: 1px solid var(--line); }
.value i { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(34,211,238,.1); color: var(--accent); font-style: normal; font-weight: 700; font-size: 14px; }
.value b { display: block; margin-bottom: 2px; }
.value span { color: var(--soft); font-size: 15px; }

/* ---------- Bento ---------- */
.bento { display: grid; gap: 16px; grid-template-columns: 1fr; }
.card {
  --x: 50%; --y: 50%;
  position: relative; padding: clamp(22px, 2.4vw, 32px); border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; isolation: isolate;
  transition: transform .45s var(--ease), border-color .3s, box-shadow .45s;
}
.card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .35s;
  background: radial-gradient(420px circle at var(--x) var(--y), rgba(34,211,238,.13), transparent 45%);
}
.card:hover { transform: translateY(-4px); border-color: rgba(34,211,238,.32); box-shadow: 0 30px 60px -30px rgba(34,211,238,.25), var(--shadow); }
.card:hover::before { opacity: 1; }
.ico { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 18px; background: linear-gradient(140deg, rgba(34,211,238,.18), rgba(59,130,246,.12)); border: 1px solid rgba(34,211,238,.25); color: var(--accent); }
.ico svg { width: 22px; height: 22px; }
.card h3 { margin-bottom: 10px; }
.card p { color: var(--soft); font-size: 15px; }
.card .example { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line-strong); font-size: 14px; color: var(--soft); }
.card .example b { color: var(--accent); font-weight: 600; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; display: block; margin-bottom: 4px; }
.card.feature { background: radial-gradient(140% 100% at 100% 0%, rgba(59,130,246,.22), transparent 55%), var(--surface); }
.card.media { padding: 0; min-height: 260px; display: flex; align-items: flex-end; }
.card.media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform 1s var(--ease); }
.card.media:hover img { transform: scale(1.05); }
.card.media::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(7,11,26,.05) 20%, rgba(7,11,26,.92)); }
.card.media .media-body { padding: clamp(22px, 2.4vw, 32px); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tag { font-size: 12px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--soft); background: rgba(255,255,255,.02); }

/* ---------- Projects ---------- */
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 28px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.filters::-webkit-scrollbar { display: none; }
.filter { flex: none; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--soft); cursor: pointer; transition: all .25s; font-size: 14px; font-weight: 500; }
.filter:hover { color: var(--text); border-color: var(--accent); }
.filter[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.projects { display: grid; gap: 18px; grid-template-columns: 1fr; }
.project { display: flex; flex-direction: column; padding: 0; transition: transform .45s var(--ease), border-color .3s, box-shadow .45s, opacity .35s; }
.project.hide { display: none; }
.project-thumb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.project-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.project:hover .project-thumb img { transform: scale(1.05); }
.thumb-art { position: absolute; inset: 0; display: grid; place-items: center; }
.thumb-art svg { width: 100%; height: 100%; }
.project-cat { position: absolute; left: 14px; top: 14px; font-size: 12px; padding: 5px 10px; border-radius: 999px; background: rgba(7,11,26,.72); border: 1px solid var(--line-strong); backdrop-filter: blur(6px); }
.project-body { padding: 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.project-body p { font-size: 15px; }
.project-result { display: flex; gap: 10px; align-items: baseline; color: var(--text); font-size: 15px; }
.project-result b { color: var(--accent); }
.project-foot { margin-top: auto; padding-top: 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; color: var(--accent); background: none; border: 0; cursor: pointer; padding: 10px 0; min-height: 44px; }
.link-arrow svg { width: 16px; height: 16px; transition: transform .3s var(--ease); }
.link-arrow:hover svg { transform: translateX(4px); }
.status { font-size: 12px; color: var(--muted); }
.status.live { color: #5eead4; }

dialog.modal {
  width: min(720px, calc(100vw - 24px)); max-height: calc(100svh - 32px); padding: 0; border: 1px solid var(--line-strong); border-radius: 24px;
  background: var(--surface); color: var(--text); box-shadow: 0 40px 120px -20px rgba(0,0,0,.8); overflow: auto;
}
dialog.modal::backdrop { background: rgba(3,6,15,.72); backdrop-filter: blur(6px); }
dialog.modal[open] { animation: pop .35s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal-head { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 22px; background: rgba(14,22,48,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); z-index: 1; }
.modal-close { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line-strong); background: transparent; cursor: pointer; font-size: 22px; line-height: 1; }
.modal-body { padding: 22px; display: grid; gap: 22px; }
.modal-body h4 { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.modal-body p, .modal-body li { color: var(--soft); }
.modal-body ul { margin: 0; padding-left: 18px; }

/* ---------- Timeline ---------- */
.timeline { position: relative; }
.tl-list { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.md-p { display: block; padding-top: 8px; }
.milestone-detail > span { display: block; }
.timeline::before { content: ""; position: absolute; left: 19px; top: 8px; bottom: 8px; width: 2px; background: var(--line); border-radius: 2px; }
.timeline-progress { position: absolute; left: 19px; top: 8px; width: 2px; height: 0; background: var(--grad); border-radius: 2px; box-shadow: 0 0 14px var(--accent-glow); transition: height .2s linear; }
.milestone { position: relative; padding-left: 58px; }
.milestone .dot { position: absolute; left: 10px; top: 22px; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line-strong); transition: border-color .3s, box-shadow .3s; }
.milestone.lit .dot { border-color: var(--accent); box-shadow: 0 0 0 5px rgba(34,211,238,.12); }
.milestone-btn > span { display: block; }
.milestone-btn .milestone-title { display: flex; }
.milestone-btn .milestone-detail { display: grid; }
.milestone-detail > span { overflow: hidden; color: var(--soft); font-size: 15px; min-height: 0; }
.milestone-btn { width: 100%; text-align: left; display: grid; gap: 6px; padding: 18px 20px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--bg-2); cursor: pointer; transition: border-color .3s, background .3s; }
.milestone-btn:hover { border-color: var(--line-strong); }
.milestone-btn[aria-expanded="true"] { border-color: rgba(34,211,238,.35); background: var(--surface); }
.milestone-year { font-size: 13px; font-weight: 600; letter-spacing: .1em; color: var(--accent); text-transform: uppercase; }
.milestone-title { font-size: clamp(18px, 1.6vw, 22px); font-weight: 600; display: flex; justify-content: space-between; gap: 12px; }
.milestone-title svg { width: 18px; height: 18px; flex: none; margin-top: 6px; color: var(--muted); transition: transform .3s var(--ease); }
.milestone-btn[aria-expanded="true"] .milestone-title svg { transform: rotate(45deg); color: var(--accent); }
.milestone-detail { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--ease); }
.milestone-detail > div { overflow: hidden; color: var(--soft); font-size: 15px; }
.milestone-btn[aria-expanded="true"] .milestone-detail { grid-template-rows: 1fr; }
.milestone-detail p { padding-top: 8px; }

/* ---------- Insights (magazine) ---------- */
.mag { display: grid; gap: 18px; }
.post { display: flex; flex-direction: column; padding: 0; }
.post .post-thumb { aspect-ratio: 16 / 9; overflow: hidden; position: relative; background: var(--surface-2); }
.post .post-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.post:hover .post-thumb img { transform: scale(1.05); }
.post-body { padding: 22px; display: grid; gap: 10px; }
.post-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.post-meta .cat { color: var(--accent); font-weight: 600; }
.post h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.post p { font-size: 15px; }
.topics { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }

/* ---------- Recognition / testimonials ---------- */
.recog { display: grid; gap: 16px; grid-template-columns: 1fr; }
.recog .card b.big { display: block; font-size: clamp(22px, 2.2vw, 28px); letter-spacing: -.02em; margin-bottom: 6px; }
.testimonial-note { margin-top: 22px; padding: 22px; border-radius: var(--radius); border: 1px dashed var(--line-strong); display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; color: var(--soft); }
.testimonial-note p { max-width: 62ch; font-size: 15px; }

/* ---------- Contact ---------- */
.contact { overflow: hidden; }
.contact-wrap { display: grid; gap: 28px; padding: clamp(24px, 5vw, 64px); border-radius: 32px; border: 1px solid var(--line); position: relative; overflow: hidden; isolation: isolate;
  background: radial-gradient(90% 120% at 100% 0%, rgba(59,130,246,.22), transparent 55%), radial-gradient(80% 100% at 0% 100%, rgba(34,211,238,.16), transparent 55%), var(--bg-2); }
.contact-title { font-size: clamp(34px, 6vw, 76px); line-height: 1.02; letter-spacing: -.035em; }
.contact-list { display: grid; gap: 10px; margin-top: 8px; }
.contact-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: rgba(255,255,255,.02); transition: border-color .25s, background .25s; min-height: 60px; }
.contact-item:hover { border-color: rgba(34,211,238,.4); background: rgba(34,211,238,.05); }
.contact-item .ico { margin: 0; width: 40px; height: 40px; border-radius: 11px; }
.contact-item .ico svg { width: 19px; height: 19px; }
.contact-item small { display: block; color: var(--muted); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.contact-item span { font-weight: 600; word-break: break-word; }
form.contact-form { display: grid; gap: 14px; padding: clamp(20px, 3vw, 32px); border-radius: var(--radius); background: rgba(7,11,26,.6); border: 1px solid var(--line); }
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; color: var(--soft); font-weight: 500; }
.field input, .field textarea, .field select {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: rgba(255,255,255,.03); color: var(--text); font: inherit; font-size: 16px; transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 130px; resize: vertical; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--soft) 50%), linear-gradient(135deg, var(--soft) 50%, transparent 50%); background-position: calc(100% - 20px) 22px, calc(100% - 15px) 22px; background-size: 5px 5px; background-repeat: no-repeat; }
.field select option { background: var(--surface); }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(34,211,238,.14); }
.field input:user-invalid, .field textarea:user-invalid { border-color: #f87171; }
.form-row { display: grid; gap: 14px; }
.hp { position: absolute; left: -9999px; }
.form-status { font-size: 14px; min-height: 1.4em; color: var(--soft); }
.form-status.ok { color: #5eead4; } .form-status.err { color: #fca5a5; }
.form-status a { color: var(--accent); text-decoration: underline; }

/* ---------- Footer ---------- */
footer { padding: 40px 0 calc(32px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.foot { display: flex; flex-wrap: wrap; gap: 16px 28px; justify-content: space-between; align-items: center; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.foot a:hover { color: var(--text); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.stagger > .reveal:nth-child(2) { transition-delay: .07s; } .stagger > .reveal:nth-child(3) { transition-delay: .14s; }
.stagger > .reveal:nth-child(4) { transition-delay: .21s; } .stagger > .reveal:nth-child(5) { transition-delay: .28s; }
.stagger > .reveal:nth-child(6) { transition-delay: .35s; }
.no-js .reveal, .no-js .hero-title .line > span, .no-js .fade-up, .no-js .hero-visual { opacity: 1; transform: none; animation: none; }
.no-js .reveal-img { clip-path: none; }

/* ---------- Article pages ---------- */
.article { padding-top: calc(var(--header-h) + 56px); }
.article-head { max-width: 820px; display: grid; gap: 18px; margin-bottom: 36px; }
.article-head h1 { font-size: clamp(32px, 5vw, 58px); line-height: 1.08; letter-spacing: -.03em; }
.article-cover { border-radius: var(--radius); overflow: hidden; aspect-ratio: 21 / 9; margin-bottom: 40px; border: 1px solid var(--line); }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.prose { max-width: 720px; font-size: clamp(16px, .3vw + 15px, 18px); color: #d6dceb; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: clamp(24px, 2.6vw, 32px); margin-top: 2em; color: var(--text); }
.prose h3 { margin-top: 1.6em; color: var(--text); }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li + li { margin-top: .4em; }
.prose strong { color: var(--text); }
.prose blockquote { margin: 1.6em 0; padding: 18px 22px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text); }
.prose .table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 480px; }
.prose th, .prose td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.prose th { color: var(--text); background: var(--surface); font-weight: 600; }
.prose td.num, .prose th.num { text-align: right; font-variant-numeric: tabular-nums; }
.back { display: inline-flex; align-items: center; gap: 8px; color: var(--soft); font-size: 14px; min-height: 44px; }
.back:hover { color: var(--accent); }
.article-cta { margin-top: 56px; max-width: 720px; padding: 26px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); display: grid; gap: 14px; }
.reading-bar { position: fixed; top: 0; left: 0; height: 2px; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: var(--grad); z-index: 60; }

/* 404 */
.notfound { min-height: 100svh; display: grid; place-items: center; text-align: center; padding: var(--gutter); }
.notfound b { font-size: clamp(90px, 20vw, 200px); line-height: 1; letter-spacing: -.05em; }

/* ---------- Page transitions (View Transitions API) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vtOut .28s var(--ease) both; }
::view-transition-new(root) { animation: vtIn .42s var(--ease) both; }
@keyframes vtOut { to { opacity: 0; transform: translateY(-8px); } }
@keyframes vtIn { from { opacity: 0; transform: translateY(10px); } }

/* =========================================================
   Breakpoints (mobile-first)
   ========================================================= */
@media (min-width: 560px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .stat { border-bottom: 0; }
  .stat:nth-child(2n) { border-right: 1px solid var(--line); }
  .stat:last-child { border-right: 0; }
  .form-row { grid-template-columns: 1fr 1fr; }
  .values { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 768px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .projects, .mag, .recog { grid-template-columns: repeat(2, 1fr); }
  .timeline::before, .timeline-progress { left: 50%; transform: translateX(-1px); }
  .milestone { width: 50%; padding-left: 0; padding-right: 44px; }
  .milestone:nth-child(odd) { margin-left: 50%; padding-left: 44px; padding-right: 0; }
  .milestone .dot { left: auto; right: -10px; }
  .milestone:nth-child(odd) .dot { left: -10px; right: auto; }
  .float-card.fc1 { left: -34px; } .float-card.fc2 { right: -34px; }
}
@media (min-width: 1024px) {
  :root { --header-h: 76px; }
  .nav-links { display: flex; gap: 28px; }
  .nav-cta { display: inline-flex; }
  .menu-btn, .mobile-menu { display: none; }
  .hero-inner { grid-template-columns: 1.15fr .85fr; gap: 64px; }
  .hero-visual { justify-self: end; }
  .scroll-hint { display: flex; }
  .about-grid { grid-template-columns: .9fr 1.1fr; gap: 80px; align-items: start; }
  .about-media { position: sticky; top: calc(var(--header-h) + 32px); }
  .bento { grid-template-columns: repeat(6, 1fr); grid-auto-rows: minmax(230px, auto); }
  .b-4 { grid-column: span 4; } .b-3 { grid-column: span 3; } .b-2 { grid-column: span 2; }
  .b-tall { grid-row: span 2; }
  .projects { grid-template-columns: repeat(3, 1fr); }
  .mag { grid-template-columns: 1.4fr 1fr; grid-template-rows: auto auto; }
  .mag .post.lead-post { grid-row: span 2; }
  .mag .post.lead-post .post-thumb { aspect-ratio: 16 / 10; }
  .mag .post.lead-post h3 { font-size: clamp(24px, 2.2vw, 32px); }
  .recog { grid-template-columns: repeat(4, 1fr); }
  .contact-wrap { grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
}
@media (min-width: 1600px) {
  :root { --max: 1400px; }
}
/* Mobile landscape: hero không cần cao 100% */
@media (max-height: 520px) and (orientation: landscape) {
  .hero { min-height: auto; }
  .hero-visual { width: min(100%, 300px); }
}

/* Giảm chuyển động */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
  .reveal, .fade-up, .hero-visual, .hero-title .line > span { opacity: 1 !important; transform: none !important; }
  .reveal-img { clip-path: none !important; }
  #bubbles { display: none; }
  @view-transition { navigation: none; }
}
