/* ======== Quan Pham CV — V2 Editorial Portal =========
   Azure portal chrome + editorial content treatment.
   Hooks preserved for scripts/main.js:
     .rail-nav a[href="#id"]     — scroll-spy
     .lang-toggle button[data-lang] + [lang=en]/[lang=sv] — i18n
     #year / #year-sv            — auto year
====================================================== */

:root {
  --bg: #ffffff;
  --canvas: #f7f6f4;
  --surface: #ffffff;

  --ink: #0a0a0a;
  --ink-1: #1b1a19;
  --ink-2: #3a3836;
  --ink-3: #605e5c;
  --ink-4: #8a8886;
  --ink-5: #c8c6c4;

  --accent: #0078d4;
  --accent-hover: #106ebe;
  --accent-deep: #004578;
  --accent-tint: #f3f9fd;

  --shell-dark: #1a1a1a;
  --shell-dark-2: #262626;
  --shell-ink: #ffffff;
  --shell-ink-mute: #bdbdbd;

  --ok: #107c10;

  --border: #ebeae7;
  --border-2: #d6d3cf;

  --font-sans: "Segoe UI Variable","Segoe UI","Inter",ui-sans-serif,system-ui,-apple-system,Roboto,sans-serif;
  --font-display: "Inter","Segoe UI Variable",sans-serif;
  --font-mono: "JetBrains Mono","Consolas",ui-monospace,monospace;

  --appbar-h: 48px;
  --siderail-w: 72px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--appbar-h) + 1rem);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: #fff; }

a { color: inherit; }
a:hover { color: var(--accent); }

/* ---- i18n ---- */
html[lang="en"] [lang="sv"],
html[lang="sv"] [lang="en"] { display: none; }

.print-only { display: none; }

/* ======================================================================
   App bar (top chrome)
====================================================================== */
.appbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--appbar-h);
  display: flex; align-items: center;
  padding: 0 16px 0 0;
  background: var(--shell-dark); color: var(--shell-ink);
  box-shadow: 0 1px 0 rgba(0,0,0,.3);
}
.appbar-brand { display: inline-flex; align-items: center; height: 100%; flex: 0 0 auto; }
.appbar-menu {
  width: 48px; height: 48px; display: grid; place-items: center;
  color: inherit; background: transparent; border: none; cursor: pointer;
}
.appbar-menu:hover { background: var(--shell-dark-2); }
.appbar-logo {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--shell-ink); text-decoration: none;
  font-weight: 600; font-size: 14px; padding: 0 10px 0 2px;
}
.appbar-logo .mark {
  display: grid; place-items: center;
  width: 22px; height: 22px; background: var(--accent);
  border-radius: 3px; font-size: 10px; font-weight: 700;
}
.appbar-logo .brand-mute { color: var(--shell-ink-mute); font-weight: 400; }

.appbar-actions { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.appbar-btn {
  height: 32px; padding: 0 12px;
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: none; color: var(--shell-ink);
  cursor: pointer; border-radius: 2px; text-decoration: none;
  font: inherit; font-size: 13px;
}
.appbar-btn:hover { background: var(--shell-dark-2); }
.appbar-btn svg { width: 14px; height: 14px; }
.appbar-btn.primary {
  background: var(--accent); color: #fff; font-weight: 600;
}
.appbar-btn.primary:hover { background: var(--accent-hover); }

.lang-toggle {
  display: inline-flex; padding: 2px; gap: 1px; height: 26px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  border-radius: 2px; margin: 0 4px 0 6px;
}
.lang-toggle button {
  appearance: none; background: transparent; border: none;
  color: var(--shell-ink-mute); font: inherit; font-size: 11px; font-weight: 600;
  letter-spacing: .08em; padding: 0 10px; cursor: pointer; border-radius: 1px;
}
.lang-toggle button:hover { color: var(--shell-ink); }
.lang-toggle button.active { background: var(--accent); color: #fff; }

/* ======================================================================
   Shell — compact icon side rail + workspace
====================================================================== */
.shell {
  display: grid;
  grid-template-columns: var(--siderail-w) 1fr;
  min-height: calc(100vh - var(--appbar-h));
}

.siderail {
  background: var(--shell-dark); color: var(--shell-ink);
  position: sticky; top: var(--appbar-h); align-self: start;
  height: calc(100vh - var(--appbar-h));
  padding: 8px 0; overflow-y: auto;
}
.rail-nav ul { list-style: none; padding: 0; margin: 0; }
.rail-nav a {
  display: grid; justify-items: center; gap: 4px;
  padding: 12px 4px;
  color: var(--shell-ink-mute); text-decoration: none;
  font-size: 10px; letter-spacing: .04em;
  border-left: 3px solid transparent;
  transition: background .12s, color .12s, border-color .12s;
}
.rail-nav a:hover { background: var(--shell-dark-2); color: var(--shell-ink); }
.rail-nav a.active {
  color: var(--shell-ink); background: var(--shell-dark-2);
  border-left-color: var(--accent);
}
.rail-nav a svg { width: 18px; height: 18px; }

/* ======================================================================
   Workspace
====================================================================== */
.workspace {
  padding: 0 0 80px;
  max-width: 1200px;
  width: 100%;
}

/* ---- Hero (also hooks .resource-head for print.css) ---- */
.hero {
  padding: 56px 64px 40px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(900px 400px at 100% 0%, rgba(0,120,212,.06), transparent 60%),
    var(--bg);
  position: relative;
}

.crumb {
  display: flex; align-items: center; gap: 8px;
  font: 500 11.5px var(--font-mono); color: var(--ink-3);
  letter-spacing: .08em; text-transform: uppercase;
  margin-bottom: 40px;
}
.crumb a { color: var(--accent); text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
.crumb .sep { color: var(--ink-5); }
.crumb .current { color: var(--ink-1); }

.hero-grid {
  display: grid; grid-template-columns: 1fr auto;
  gap: 48px; align-items: end;
}

.hero-left .kind,
.hero-left .resource-kind {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 11px var(--font-sans); letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent-deep);
  margin-bottom: 16px;
}
.hero-left .kind::before,
.hero-left .resource-kind::before {
  content: ""; width: 24px; height: 1px; background: var(--accent);
}
.hero-left .name,
.hero-left h1 {
  font-family: var(--font-display);
  margin: 0 0 8px;
  font-size: 88px; font-weight: 700;
  letter-spacing: -.045em; line-height: .96;
  color: var(--ink);
}
.hero-left .name .n-part { display: block; }
.hero-left .name .dot { color: var(--accent); }

.hero-left .role-lede,
.hero-left .subtitle {
  font-size: 22px; color: var(--ink-2); font-weight: 400;
  letter-spacing: -.01em; max-width: 560px; line-height: 1.35;
  margin: 0;
}
.hero-left .role-lede b,
.hero-left .subtitle b { color: var(--ink); font-weight: 600; }

.hero-left .meta-row {
  display: flex; gap: 12px 24px; flex-wrap: wrap; align-items: center;
  margin-top: 28px; font-size: 13px; color: var(--ink-3);
}
.hero-left .meta-row .item {
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none; color: var(--ink-3);
}
.hero-left .meta-row .item:hover { color: var(--accent-deep); }
.hero-left .meta-row svg { width: 13px; height: 13px; color: var(--accent); }
.hero-left .status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; background: #e6f5e6; border: 1px solid #b6daae;
  border-radius: 100px; font: 500 12px var(--font-sans); color: #0b5e0b;
}
.hero-left .status .dot2 {
  width: 7px; height: 7px; border-radius: 50%; background: #107c10;
  box-shadow: 0 0 0 3px rgba(16,124,16,.2);
}

.hero-right {
  display: flex; flex-direction: column; align-items: flex-end; gap: 16px;
}
.hero-photo,
.resource-icon {
  width: 200px; height: 260px; overflow: hidden;
  border-radius: 2px; background: var(--accent-deep);
  box-shadow: 0 20px 60px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.06);
  position: relative;
  display: block;
}
.hero-photo img,
.resource-icon img { width: 100%; height: 100%; object-fit: cover; }
.hero-photo::after {
  content: "PORTRAIT — Q. PHAM · 2026";
  position: absolute; bottom: -22px; right: 0;
  font: 500 10px var(--font-mono); letter-spacing: .12em;
  color: var(--ink-4);
}

/* ---- Command row ---- */
.command-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 18px 64px; border-bottom: 1px solid var(--border);
  background: var(--canvas);
}
.command-row a, .command-row button {
  appearance: none; background: var(--surface); border: 1px solid var(--border);
  color: var(--ink-1); font: inherit; font-size: 13px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; cursor: pointer; text-decoration: none;
  border-radius: 100px; transition: all .15s;
}
.command-row a:hover, .command-row button:hover {
  border-color: var(--accent); color: var(--accent-deep); background: #fff;
}
.command-row svg { width: 13px; height: 13px; color: var(--accent); }
.command-row .primary {
  background: var(--ink); color: #fff; border-color: var(--ink);
}
.command-row .primary svg { color: #fff; }
.command-row .primary:hover {
  background: var(--accent); border-color: var(--accent); color: #fff;
}

/* ======================================================================
   Article layout — sticky section cap + content column
====================================================================== */
.article {
  padding: 56px 64px 0;
}
.row {
  display: grid; grid-template-columns: 200px 1fr;
  gap: 48px;
}

.sidecap {
  position: sticky; top: calc(var(--appbar-h) + 24px);
  align-self: start;
  font-family: var(--font-sans);
}
.sidecap .n {
  display: inline-block; padding: 2px 8px;
  background: var(--ink); color: #fff; border-radius: 2px;
  margin-right: 8px; font: 600 11px var(--font-mono);
  letter-spacing: .1em;
}
.sidecap .title {
  display: block; margin-top: 10px;
  color: var(--ink-1); font-size: 14px; font-weight: 600;
}
.sidecap .sub {
  display: block; margin-top: 4px;
  color: var(--ink-3); font-size: 12px;
}

.row > .sidecap + * {
  padding-bottom: 56px; border-bottom: 1px solid var(--border);
  margin-bottom: 56px;
}
.row:last-child > .sidecap + * {
  border-bottom: none;
  margin-bottom: 0;
}

/* Content typography */
p.lead {
  font-size: 22px; line-height: 1.4; color: var(--ink-1);
  font-weight: 400; letter-spacing: -.01em;
  margin: 0 0 16px; max-width: 700px;
}
p { color: var(--ink-1); margin: 12px 0; max-width: 720px; font-size: 15.5px; line-height: 1.65; }

/* ---- Role card ---- */
.role-card {
  display: block;
  padding: 28px 0;
  border-top: 1px solid var(--border);
}
.role-list > .role-card:first-child { border-top: none; padding-top: 0; }
.role-year {
  display: block;
  font: 600 11px var(--font-mono);
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 10px;
}
.role-year .y-from,
.role-year .y-to {
  display: inline;
  font: inherit; letter-spacing: inherit;
}
.role-year .y-from,
.role-year .y-to { color: var(--ink-3); }
.role-year .y-from::after {
  content: " \2014  ";
  color: var(--accent);
  font-weight: 700;
}
.role-body h3 {
  margin: 0; font-size: 22px; font-weight: 600;
  letter-spacing: -.015em; color: var(--ink);
}
.role-body .where,
.role-body .role-where {
  margin: 6px 0 18px;
  font-size: 15px; color: var(--accent-deep); font-weight: 600;
}

.bullets {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 10px; max-width: 720px;
}
.bullets li {
  position: relative; padding-left: 24px;
  font-size: 15.5px; color: var(--ink-1); line-height: 1.65;
}
.bullets li::before {
  content: "→"; position: absolute; left: 0; top: 0;
  color: var(--accent); font-weight: 600;
  line-height: 1.65;
}

/* ---- Tags ---- */
.tags {
  list-style: none; padding: 0; margin: 16px 0 0;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.tags li {
  font: 500 11.5px var(--font-mono);
  padding: 3px 10px; border: 1px solid var(--border-2);
  border-radius: 2px; color: var(--ink-2); background: var(--canvas);
  transition: all .12s;
}
.tags li:hover {
  border-color: var(--accent); background: var(--accent-tint);
  color: var(--accent-deep);
}

/* ---- Employers horizontal timeline ---- */
.employers { position: relative; padding: 24px 0 8px; }
.employers::before {
  content: ""; position: absolute; left: 0; right: 0; top: 64px;
  height: 1px; background: var(--border-2);
}
.employers-row {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 20px; position: relative;
}
.emp { padding-top: 52px; position: relative; font-size: 13px; }
.emp::before {
  content: ""; position: absolute; top: 36px; left: 0;
  width: 9px; height: 9px; border-radius: 50%;
  background: #fff; border: 2px solid var(--accent);
}
.emp.current::before {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(0,120,212,.15);
}
.emp .when {
  font: 500 11px var(--font-mono); letter-spacing: .06em;
  color: var(--ink-3); margin-bottom: 4px; text-transform: uppercase;
}
.emp .where {
  font-size: 15px; font-weight: 600; color: var(--ink);
}
.emp .role-text { margin-top: 2px; color: var(--ink-3); font-size: 12px; }

/* ---- Skills ---- */
.skill-groups {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px;
}
.skill-groups h3 {
  margin: 0 0 14px;
  font: 700 11px var(--font-sans); letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3);
}
.skill-groups .tags li { font-size: 13px; padding: 6px 12px; }

/* ---- Languages ---- */
.lang-list { list-style: none; padding: 0; margin: 0; }
.lang-list li {
  display: grid; grid-template-columns: 160px 1fr auto;
  align-items: center; gap: 20px;
  padding: 16px 0; border-top: 1px solid var(--border);
}
.lang-list li:first-child { border-top: none; }
.lang-list .lang-name {
  font-size: 17px; font-weight: 600;
  color: var(--ink); letter-spacing: -.005em;
}
.lang-list .lang-bar {
  height: 3px; background: var(--border);
  overflow: hidden; border-radius: 2px; max-width: 520px;
}
.lang-list .lang-bar span { display: block; height: 100%; background: var(--accent); }
.lang-list .lang-level {
  font: 500 11px var(--font-mono); letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-3);
}

/* ---- Footer ---- */
.page-footer {
  padding: 32px 64px; margin-top: 56px;
  border-top: 1px solid var(--border);
  color: var(--ink-3); font-size: 13px;
  display: flex; justify-content: space-between; align-items: center;
}
.page-footer a { color: var(--accent); text-decoration: none; }
.page-footer a:hover { text-decoration: underline; }

/* ======================================================================
   Responsive
====================================================================== */
@media (max-width: 1024px) {
  .hero { padding: 40px 40px 32px; }
  .hero-left .name { font-size: 68px; }
  .article { padding: 40px 40px 0; grid-template-columns: 180px 1fr; gap: 32px; }
  .command-row { padding: 14px 40px; }
  .page-footer { padding: 24px 40px; }
}

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .siderail {
    position: sticky; top: var(--appbar-h);
    height: auto; width: 100%; padding: 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
    z-index: 90;
  }
  .rail-nav ul { display: flex; overflow-x: auto; }
  .rail-nav a {
    flex-direction: column; padding: 8px 14px;
    border-left: none; border-bottom: 3px solid transparent;
    font-size: 10px; white-space: nowrap;
  }
  .rail-nav a.active {
    border-left: none; border-bottom-color: var(--accent);
  }

  .hero { padding: 32px 24px; }
  .hero-grid { grid-template-columns: 1fr; gap: 28px; align-items: start; }
  .hero-right { order: -1; flex-direction: row; }
  .hero-photo, .resource-icon { width: 120px; height: 150px; }
  .hero-photo::after { display: none; }
  .hero-left .name { font-size: 56px; line-height: 1; }
  .hero-left .role-lede, .hero-left .subtitle { font-size: 18px; }

  .command-row { padding: 12px 24px; }
  .article { padding: 32px 24px 0; }
  .row { grid-template-columns: 1fr; gap: 0; }
  .sidecap { position: static; margin-bottom: 16px; }
  .row > .sidecap + * { padding-bottom: 32px; margin-bottom: 32px; }

  .role-card { padding: 20px 0; }

  .employers-row { grid-template-columns: 1fr 1fr; }
  .skill-groups { grid-template-columns: 1fr; gap: 24px; }
  .lang-list li { grid-template-columns: 1fr auto; }
  .lang-list .lang-bar { grid-column: 1 / -1; }

  .page-footer {
    flex-direction: column; gap: 8px; text-align: center;
    padding: 20px 24px;
  }

}

@media (max-width: 480px) {
  .hero-left .name { font-size: 44px; }
  .crumb { margin-bottom: 24px; }
  .command-row { gap: 6px; }
  .command-row a, .command-row button { padding: 7px 12px; font-size: 12.5px; }
}
