/* Portfolio of Vu Dang Cong Lan — lan.goghim.vn
   Palette and type follow the printed CV (navy ink, blue accent, Inter). */

:root {
  --bg: #fbfcfe;
  --surface: #ffffff;
  --tint: #f1f4f9;
  --ink: #1b2333;
  --heading: #13294b;
  --muted: #5b6577;
  --line: #e1e6ee;
  --accent: #2459c9;
  --accent-ink: #ffffff;
  --chip: #e9eef8;
  --shadow: 0 1px 2px rgba(19, 41, 75, .05), 0 8px 24px rgba(19, 41, 75, .06);
  --radius: 14px;
  --wrap: 1120px;
  --gutter: 24px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1320;
    --surface: #141c2c;
    --tint: #111a29;
    --ink: #dbe2ee;
    --heading: #f2f5fb;
    --muted: #96a1b5;
    --line: #243045;
    --accent: #6d9bff;
    --accent-ink: #0d1320;
    --chip: #1d2940;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 "Inter", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* Language switch: the page carries both languages, the html element says which one shows.
   Without JavaScript the static data-ui="en" keeps English visible. */
html[data-ui="en"] body [lang="vi"],
html[data-ui="vi"] body [lang="en"] { display: none !important; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
@media (max-width: 640px) { :root { --gutter: 16px; } }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--heading); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: var(--heading); color: var(--bg); font-weight: 800; font-size: 15px;
}
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { color: var(--muted); font-size: 15px; font-weight: 500; }
.nav a:hover { color: var(--heading); text-decoration: none; }
.header-actions { display: flex; align-items: center; gap: 10px; }
@media (max-width: 860px) { .nav { display: none; } .header-actions { margin-left: auto; } }

.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--surface); }
.lang-switch button {
  border: 0; background: transparent; color: var(--muted); font: 600 13px/1 inherit;
  padding: 7px 11px; border-radius: 999px; cursor: pointer; min-width: 40px; min-height: 32px;
}
.lang-switch button[aria-pressed="true"] { background: var(--heading); color: var(--bg); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 20px;
  border-radius: 999px; font-weight: 600; font-size: 15px; border: 1px solid transparent;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-ghost { border-color: var(--line); color: var(--heading); background: var(--surface); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-small { min-height: 36px; padding: 0 14px; font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .btn, .btn:hover { transition: none; transform: none; } }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 56px; }
.hero .wrap { display: grid; grid-template-columns: 1fr 300px; gap: 56px; align-items: center; }
.eyebrow { color: var(--accent); font-weight: 600; font-size: 15px; margin: 0 0 14px; }
h1 {
  font-size: clamp(34px, 5vw, 54px); line-height: 1.08; letter-spacing: -0.02em;
  color: var(--heading); margin: 0 0 20px; font-weight: 800; text-wrap: balance;
}
.lead { font-size: 18px; color: var(--muted); max-width: 620px; margin: 0 0 28px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.portrait {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 22px;
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
.stats { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 12px 40px; margin-top: 40px; }
.stat b { display: block; font-size: 28px; line-height: 1.1; color: var(--heading); font-weight: 800; }
.stat > span { font-size: 14px; color: var(--muted); }
@media (max-width: 860px) {
  .hero { padding: 40px 0 32px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 28px; }
  .hero-photo { order: -1; }
  .portrait { width: 132px; border-radius: 18px; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .stat b { font-size: 22px; }
  .stat > span { font-size: 13px; }
}

/* ---------- Sections ---------- */
section.block { padding: 64px 0; border-top: 1px solid var(--line); }
@media (max-width: 640px) { section.block { padding: 44px 0; } }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
h2 { font-size: clamp(26px, 3vw, 32px); letter-spacing: -0.01em; color: var(--heading); margin: 0; }
h3 { color: var(--heading); margin: 0; font-size: 20px; line-height: 1.3; }
.kicker { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 0 0 6px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- Experience ---------- */
.job { padding: 28px; }
.job + .job { margin-top: 16px; }
.job-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; align-items: baseline; }
.job-head .org { color: var(--muted); font-weight: 500; }
.dates { font-size: 14px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.context { color: var(--muted); font-size: 15px; margin: 6px 0 14px; }
.job p.summary { margin: 0 0 20px; font-weight: 500; }
.highlights { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.highlight { background: var(--tint); border-radius: 10px; padding: 14px 16px; }
.highlight h4 { margin: 0 0 4px; font-size: 15px; color: var(--heading); }
.highlight p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink); }
@media (max-width: 960px) { .highlights { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .highlights { grid-template-columns: 1fr; } .job { padding: 20px; } }
.job ul { margin: 0 0 16px; padding-left: 20px; }
.job li { margin-bottom: 6px; }
.job li::marker { color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { font-size: 13px; font-weight: 500; color: var(--heading); background: var(--chip); border-radius: 6px; padding: 3px 9px; }
.earlier { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.earlier .job + .job { margin-top: 0; }
@media (max-width: 860px) { .earlier { grid-template-columns: 1fr; } }
.edu { margin-top: 16px; padding: 20px 28px; display: flex; flex-wrap: wrap; gap: 6px 24px; align-items: baseline; }
.edu b { color: var(--heading); }
.edu span { color: var(--muted); font-size: 15px; }
@media (max-width: 600px) { .edu { padding: 18px 20px; } }

/* ---------- Projects ---------- */
.project { display: grid; grid-template-columns: 1.05fr 1fr; overflow: hidden; }
.project + .project, .arch + .project { margin-top: 20px; }
.project-media {
  margin: 0;
  background: var(--tint); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 24px;
}
.project-media img { width: 100%; border-radius: 10px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.project-media figcaption { font-size: 13px; color: var(--muted); text-align: center; }
.project-body { padding: 28px; }
.project-body .meta { color: var(--muted); font-size: 14px; margin: 6px 0 14px; }
.project-body ul { padding-left: 20px; margin: 14px 0 18px; }
.project-body li { margin-bottom: 6px; }
.project-body li::marker { color: var(--accent); }
.project-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; }
.note { font-size: 13px; color: var(--muted); }
@media (max-width: 900px) {
  .project { grid-template-columns: 1fr; }
  .project-media { border-right: 0; border-bottom: 1px solid var(--line); padding: 16px; }
  .project-body { padding: 20px; }
}

/* Goghim architecture, drawn as stacked layers */
.arch { margin-top: 20px; padding: 24px 28px; }
.arch h3 { font-size: 17px; margin-bottom: 16px; }
.layer { display: grid; grid-template-columns: 110px 1fr; gap: 14px; align-items: center; }
.layer + .layer { margin-top: 10px; }
.layer-name { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.layer-boxes { display: flex; flex-wrap: wrap; gap: 8px; position: relative; }
.layer-boxes span {
  border: 1px solid var(--line); background: var(--tint); border-radius: 8px;
  padding: 7px 12px; font-size: 14px; font-weight: 500; color: var(--heading);
}
.layer-boxes span small { color: var(--muted); font-weight: 400; }
.layer.edge .layer-boxes span { background: var(--heading); color: var(--bg); border-color: var(--heading); }
.layer.edge .layer-boxes span small { color: inherit; opacity: .75; }
.arrow { margin: 4px 0 4px 124px; color: var(--muted); font-size: 14px; line-height: 1; }
.arch .caption { margin: 16px 0 0; font-size: 14px; color: var(--muted); }
@media (max-width: 640px) {
  .arch { padding: 20px; }
  .layer { grid-template-columns: 1fr; gap: 6px; }
  .arrow { margin-left: 0; }
}

/* ---------- Skills ---------- */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.skill { padding: 20px 22px; }
.skill h3 { font-size: 15px; margin-bottom: 10px; }
@media (max-width: 860px) { .skills { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .skills { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */
.contact { text-align: center; padding: 48px 28px; }
.contact p { color: var(--muted); max-width: 520px; margin: 12px auto 24px; }
.contact .cta { justify-content: center; }
.email-line { font-size: clamp(20px, 3vw, 26px); font-weight: 700; color: var(--heading); word-break: break-all; }

.site-footer { padding: 32px 0 48px; color: var(--muted); font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
