﻿/* ============================================================
   Trần Sơn Nam — Project Manager CV
   Executive dark theme · champagne-gold accent
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  color-scheme: dark;

  /* surfaces */
  --bg: #07090f;
  --bg-alt: #0a0d16;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-2: rgba(255, 255, 255, 0.055);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --header-bg: rgba(9, 11, 17, 0.6);
  --header-bg-scrolled: rgba(8, 9, 14, 0.88);
  --tip-bg: rgba(14, 16, 22, 0.92);
  --tip-bg-solid: rgba(13, 15, 22, 0.97);
  --node-fill: #0d1018;
  --grid-line: rgba(255, 255, 255, 0.025);
  --bar-track: rgba(255, 255, 255, 0.06);
  --chip-bg: rgba(255, 255, 255, 0.04);
  --glow-opacity: 0.5;

  /* champagne gold */
  --gold-100: #f6e7bf;
  --gold-300: #f2d99a;
  --gold-500: #caa25a;
  --gold-700: #8a6a30;
  --gold-grad: linear-gradient(135deg, var(--gold-300), var(--gold-500) 55%, var(--gold-700));
  --on-gold: #17120a;

  /* text */
  --text: #e9ecf3;
  --text-dim: #9aa3b5;
  --text-faint: #5d6577;
  --selection-text: #fff;

  /* type */
  --font-sans: 'Be Vietnam Pro', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;

  /* rhythm */
  --container: 1180px;
  --radius: 18px;
  --radius-sm: 10px;
  --header-h: 68px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Light theme ---------- */
html[data-theme="light"] {
  color-scheme: light;

  /* surfaces — warm ivory to keep the champagne-gold identity */
  --bg: #f7f5ef;
  --bg-alt: #efece3;
  --surface: rgba(63, 50, 24, 0.04);
  --surface-2: rgba(63, 50, 24, 0.065);
  --border: rgba(63, 50, 24, 0.12);
  --border-strong: rgba(63, 50, 24, 0.2);
  --header-bg: rgba(247, 245, 239, 0.72);
  --header-bg-scrolled: rgba(247, 245, 239, 0.93);
  --tip-bg: rgba(255, 253, 247, 0.95);
  --tip-bg-solid: rgba(255, 253, 247, 0.98);
  --node-fill: #f7f5ef;
  --grid-line: rgba(63, 50, 24, 0.055);
  --bar-track: rgba(63, 50, 24, 0.1);
  --chip-bg: rgba(63, 50, 24, 0.05);
  --glow-opacity: 0.3;

  /* gold flips darker so it stays readable on ivory */
  --gold-100: #6b4f1a;
  --gold-300: #8a6426;
  --gold-500: #a87e35;
  --gold-700: #c9a254;
  --on-gold: #fffdf6;

  /* text */
  --text: #29251d;
  --text-dim: #5f594c;
  --text-faint: #948d7d;
  --selection-text: #29251d;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

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

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
b, strong { font-weight: 700; color: var(--text); }

.container { max-width: var(--container); margin: 0 auto; padding: 0 28px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--gold-500); color: var(--on-gold); padding: 10px 18px;
  border-radius: 0 0 var(--radius-sm) 0; font-weight: 600;
}
.skip-link:focus { left: 0; }

::selection { background: rgba(202, 162, 90, 0.35); color: var(--selection-text); }

/* ---------- Ambient background ---------- */
.bg-ornament { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }

.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 75%);
}

.bg-glow { position: absolute; border-radius: 50%; filter: blur(120px); opacity: var(--glow-opacity); }
.bg-glow-1 {
  width: 640px; height: 640px; top: -220px; right: -140px;
  background: radial-gradient(circle, rgba(202, 162, 90, 0.16), transparent 65%);
}
.bg-glow-2 {
  width: 560px; height: 560px; top: 42%; left: -220px;
  background: radial-gradient(circle, rgba(64, 96, 160, 0.14), transparent 65%);
}

/* ---------- Header / nav ---------- */
header#site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
header#site-header.scrolled {
  background: var(--header-bg-scrolled);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}
html[data-theme="light"] header#site-header.scrolled { box-shadow: 0 8px 30px rgba(63, 50, 24, 0.12); }

/* reading-progress bar doubles as the header's bottom edge */
.scroll-progress {
  position: fixed; top: var(--header-h); left: 0; right: 0; height: 2px; z-index: 101;
  background: var(--border);
}
.scroll-progress span {
  display: block; height: 100%; width: 0;
  background: var(--gold-grad);
  transition: width 0.1s linear;
}

/* the bar spans the full viewport width; its content stays aligned
   to the same container width as the rest of the page */
.nav-container {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
}

.logo { display: flex; align-items: center; gap: 11px; flex: none; white-space: nowrap; }
.logo-photo {
  display: block; width: 36px; height: 36px; border-radius: 50%; flex: none;
  overflow: hidden;
  border: 1.5px solid rgba(242, 217, 154, 0.4);
  transition: border-color 0.25s;
}
.logo:hover .logo-photo { border-color: var(--gold-300); }
.logo-photo img { width: 100%; height: 100%; object-fit: cover; }
.logo-text { font-size: 0.94rem; font-weight: 700; letter-spacing: 0.01em; color: var(--text); }

/* header brief contact info — the "menu" content */
.header-contact {
  display: flex; align-items: center; justify-content: center;
  flex: 1; min-width: 0;
  gap: 30px; flex-wrap: wrap;
}
.header-contact li {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.84rem; color: var(--text-dim); white-space: nowrap;
}
.header-contact li.divider { width: 1px; height: 14px; background: var(--border-strong); flex: none; }
.header-contact a { display: flex; align-items: center; gap: 8px; transition: color 0.25s; }
.header-contact a:hover { color: var(--gold-300); }
.header-contact svg {
  width: 14px; height: 14px; flex: none;
  fill: none; stroke: var(--gold-300); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

.nav-cta { flex: none; }

/* ---------- Right-edge rail: theme toggle + quick-jump nav ---------- */
.side-rail {
  position: fixed; top: 50%; right: 22px; z-index: 90;
  transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}

.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  cursor: pointer;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--gold-300);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: border-color 0.25s, background 0.25s, color 0.25s, transform 0.25s var(--ease-out), box-shadow 0.25s;
}
.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--gold-500); color: var(--gold-100);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}
.theme-toggle svg {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
/* the icon shows the mode you would switch TO */
.theme-toggle .icon-moon { display: none; }
html[data-theme="light"] .theme-toggle .icon-sun { display: none; }
html[data-theme="light"] .theme-toggle .icon-moon { display: block; }

.side-nav { position: relative; }

/* ============================================================
   Theme-switch overlay — the "celestial handoff"
   Toggling to dark: the sun holds center stage, the moon glides
   in from the RIGHT and pushes it off to the left.
   Toggling to light: the sun returns from the LEFT and pushes
   the moon off to the right. One shared 2.4s timeline.
   ============================================================ */
.theme-transition {
  position: fixed; inset: 0; z-index: 200;
  pointer-events: none;
  opacity: 0; visibility: hidden;
}
.theme-transition.is-active { visibility: visible; animation: tt-overlay 2.4s ease both; }

/* frosted veil + a gold aura breathing from the center */
.theme-transition::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(202, 162, 90, 0.2), transparent 58%);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.theme-transition.to-dark::before { background-color: rgba(5, 7, 12, 0.45); }
.theme-transition.to-light::before { background-color: rgba(247, 245, 239, 0.5); }

.tt-stage {
  position: relative; width: 100%; height: 100%;
  display: grid; place-items: center;
  overflow: hidden;
}

/* soft halo the icons sit on */
.tt-halo {
  grid-area: 1 / 1;
  width: clamp(260px, 40vw, 430px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 217, 154, 0.45), rgba(202, 162, 90, 0.16) 45%, transparent 70%);
  filter: blur(6px);
  opacity: 0;
}
.theme-transition.is-active .tt-halo { animation: tt-halo 2.4s ease both; }

/* comet streak tracing the newcomer's flight path */
.tt-trail {
  position: absolute; top: calc(50% - 1px); height: 2px; width: 62vw;
  background: linear-gradient(90deg, rgba(202, 162, 90, 0), rgba(242, 217, 154, 0.7), rgba(202, 162, 90, 0));
  box-shadow: 0 0 18px rgba(202, 162, 90, 0.5);
  opacity: 0;
}
.theme-transition.to-dark .tt-trail { left: 50%; transform-origin: left center; }
.theme-transition.to-light .tt-trail { right: 50%; transform-origin: right center; }
.theme-transition.is-active .tt-trail { animation: tt-trail 2.4s ease both; }

.tt-icon {
  grid-area: 1 / 1; /* stacked dead-center; keyframes move them */
  width: clamp(110px, 16vw, 170px); height: auto;
  fill: none; stroke: var(--gold-300); stroke-width: 1.3;
  stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 0 30px rgba(202, 162, 90, 0.6));
  opacity: 0;
  will-change: transform, opacity;
}
.theme-transition.to-dark  .tt-sun  { animation: tt-exit-left 2.4s linear both; }
.theme-transition.to-dark  .tt-moon { animation: tt-enter-right 2.4s linear both; }
.theme-transition.to-light .tt-moon { animation: tt-exit-right 2.4s linear both; }
.theme-transition.to-light .tt-sun  { animation: tt-enter-left 2.4s linear both; }

/* sparkles that twinkle once the newcomer settles */
.tt-spark {
  position: absolute; top: 50%; left: 50%;
  border-radius: 50%;
  background: var(--gold-300);
  box-shadow: 0 0 12px rgba(202, 162, 90, 0.85);
  opacity: 0;
}
.tt-spark-1 { width: 6px; height: 6px; margin: -76px 0 0 -108px; }
.tt-spark-2 { width: 5px; height: 5px; margin: -112px 0 0 74px; }
.tt-spark-3 { width: 4px; height: 4px; margin: 62px 0 0 -88px; }
.tt-spark-4 { width: 7px; height: 7px; margin: 94px 0 0 112px; }
.theme-transition.is-active .tt-spark { animation: tt-spark 2.4s ease both; }
.theme-transition.is-active .tt-spark-2 { animation-delay: 0.14s; }
.theme-transition.is-active .tt-spark-3 { animation-delay: 0.26s; }
.theme-transition.is-active .tt-spark-4 { animation-delay: 0.38s; }

/* ----- shared 2.4s timeline (percentages ≈ ms/24) ----- */
@keyframes tt-overlay {
  0% { opacity: 0; }
  8%, 84% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes tt-halo {
  0% { opacity: 0; transform: scale(0.4); }
  12%, 44% { opacity: 0.9; transform: scale(1); }
  54% { opacity: 1; transform: scale(1.28); } /* flash on impact */
  68% { opacity: 0.85; transform: scale(1.02); }
  100% { opacity: 0.85; transform: scale(1.08); }
}

@keyframes tt-trail {
  0%, 20% { opacity: 0; transform: scaleX(1); }
  30% { opacity: 0.65; transform: scaleX(0.85); }
  46% { opacity: 0.4; transform: scaleX(0.12); }
  58%, 100% { opacity: 0; transform: scaleX(0); }
}

/* incumbent: springy entrance at center, then shoved off stage */
@keyframes tt-exit-left {
  0% { opacity: 0; transform: translateX(0) scale(0.4) rotate(-40deg); animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1); }
  11% { opacity: 1; transform: translateX(0) scale(1.07) rotate(4deg); }
  17% { transform: translateX(0) scale(1) rotate(0deg); }
  44% { opacity: 1; transform: translateX(0) scale(1) rotate(0deg); animation-timing-function: cubic-bezier(0.5, 0, 0.65, 0.3); }
  53% { opacity: 0.9; transform: translateX(-11vw) scale(0.9) rotate(-16deg); animation-timing-function: cubic-bezier(0.2, 0, 0.45, 1); }
  74%, 100% { opacity: 0; transform: translateX(-68vw) scale(0.55) rotate(-50deg); }
}
@keyframes tt-exit-right {
  0% { opacity: 0; transform: translateX(0) scale(0.4) rotate(40deg); animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1); }
  11% { opacity: 1; transform: translateX(0) scale(1.07) rotate(-4deg); }
  17% { transform: translateX(0) scale(1) rotate(0deg); }
  44% { opacity: 1; transform: translateX(0) scale(1) rotate(0deg); animation-timing-function: cubic-bezier(0.5, 0, 0.65, 0.3); }
  53% { opacity: 0.9; transform: translateX(11vw) scale(0.9) rotate(16deg); animation-timing-function: cubic-bezier(0.2, 0, 0.45, 1); }
  74%, 100% { opacity: 0; transform: translateX(68vw) scale(0.55) rotate(50deg); }
}

/* newcomer: glides in from the edge, nudges past center, settles */
@keyframes tt-enter-right {
  0%, 18% { opacity: 0; transform: translateX(64vw) scale(0.85) rotate(24deg); animation-timing-function: linear; }
  26% { opacity: 1; transform: translateX(40vw) scale(0.9) rotate(16deg); animation-timing-function: cubic-bezier(0.25, 0.6, 0.35, 1); }
  45% { transform: translateX(4.5vw) scale(1) rotate(2deg); animation-timing-function: cubic-bezier(0.34, 1.3, 0.64, 1); }
  56% { transform: translateX(-1.6vw) scale(1.04) rotate(-2deg); }
  65% { transform: translateX(0) scale(1) rotate(0deg); }
  76% { transform: translateX(0) scale(1.05) rotate(0deg); } /* proud little breath */
  86%, 100% { opacity: 1; transform: translateX(0) scale(1) rotate(0deg); }
}
@keyframes tt-enter-left {
  0%, 18% { opacity: 0; transform: translateX(-64vw) scale(0.85) rotate(-130deg); animation-timing-function: linear; }
  26% { opacity: 1; transform: translateX(-40vw) scale(0.9) rotate(-90deg); animation-timing-function: cubic-bezier(0.25, 0.6, 0.35, 1); }
  45% { transform: translateX(-4.5vw) scale(1) rotate(-10deg); animation-timing-function: cubic-bezier(0.34, 1.3, 0.64, 1); }
  56% { transform: translateX(1.6vw) scale(1.04) rotate(3deg); }
  65% { transform: translateX(0) scale(1) rotate(0deg); }
  76% { transform: translateX(0) scale(1.05) rotate(0deg); }
  86%, 100% { opacity: 1; transform: translateX(0) scale(1) rotate(0deg); }
}
@keyframes tt-spark {
  0%, 58% { opacity: 0; transform: scale(0.2); }
  66% { opacity: 1; transform: scale(1); }
  73% { opacity: 0.35; transform: scale(0.7); }
  80% { opacity: 0.95; transform: scale(1.05); }
  91%, 100% { opacity: 0; transform: scale(0.3); }
}
.side-nav ul { display: flex; flex-direction: column; align-items: center; gap: 9px; }
.side-nav li { position: relative; }
.side-nav a { display: flex; align-items: center; padding: 5px 2px; }

.side-dot {
  width: 26px; height: 3px; border-radius: 2px; flex: none;
  background: var(--border-strong);
  transition: background 0.3s, box-shadow 0.3s;
}
.side-nav a:hover .side-dot,
.side-nav a:focus-visible .side-dot { background: var(--gold-300); }
.side-nav a.active .side-dot {
  background: var(--gold-grad);
  box-shadow: 0 0 10px rgba(202, 162, 90, 0.5);
}

.side-tip {
  position: absolute; top: 50%; right: calc(100% + 16px);
  transform: translateY(-50%) translateX(8px);
  white-space: nowrap;
  font-size: 0.82rem; font-weight: 500; color: var(--text);
  background: var(--tip-bg);
  border: 1px solid var(--border-strong);
  padding: 8px 16px; border-radius: 999px;
  opacity: 0; visibility: hidden; pointer-events: none;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out), visibility 0.25s;
}
.side-nav a:hover .side-tip,
.side-nav a:focus-visible .side-tip {
  opacity: 1; visibility: visible; transform: translateY(-50%) translateX(0);
}

@media (prefers-reduced-motion: reduce) {
  .side-dot, .side-tip { transition: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px; border-radius: 999px;
  font-weight: 600; font-size: 0.95rem; line-height: 1;
  cursor: pointer; border: 1px solid transparent;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s, background 0.25s, border-color 0.25s;
}
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.btn-gold {
  background: var(--gold-grad); color: var(--on-gold);
  box-shadow: 0 6px 24px rgba(202, 162, 90, 0.32);
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(202, 162, 90, 0.45); }

.btn-ghost { border-color: var(--border-strong); color: var(--text); background: var(--surface); }
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--gold-500); color: var(--gold-300); }

.btn-sm { padding: 10px 18px; font-size: 0.88rem; }

/* ---------- Hero ---------- */
.hero {
  min-height: min(80vh, 740px);
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--header-h) + 40px) 0 48px;
  position: relative;
}

.hero-grid {
  display: grid; grid-template-columns: 1.1fr 0.95fr;
  gap: 48px; align-items: center;
}

.hero-eyebrow {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--gold-300);
  margin-bottom: 18px;
}
.eyebrow-line { width: 44px; height: 1px; background: var(--gold-grad); flex: none; }

/* name + role sit under the photo, so the scale is tuned to that
   narrower column rather than the full text measure */
.hero-title {
  /* inline-block so the gradient is clipped to the name itself rather than
     stretched across the whole centred column */
  display: inline-block;
  font-size: clamp(2rem, 3vw, 2.7rem);
  font-weight: 800; line-height: 1.12; letter-spacing: -0.02em;
  margin-bottom: 8px;
  /* all three words share one ramp; it stays in the bright half of the scale
     because --gold-grad bottoms out at #8a6a30 and would sink the last word
     into the dark background */
  background: linear-gradient(115deg, var(--gold-100), var(--gold-300) 42%, var(--gold-500));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero-title em { font-style: normal; }

.hero-role {
  font-size: 0.98rem; font-weight: 600; color: var(--gold-100);
  letter-spacing: 0.01em; margin-bottom: 14px;
}

.hero-desc { max-width: 56ch; color: var(--text-dim); font-size: 1.05rem; margin-bottom: 24px; }
.hero-desc b { color: var(--gold-100); font-weight: 600; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 30px; }

/* hero visual */
.hero-visual { display: flex; flex-direction: column; align-items: center; gap: 26px; }

.avatar-frame { position: relative; width: min(360px, 78vw); aspect-ratio: 1; }

.avatar-ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.ring-spin { transform-origin: center; animation: spin 46s linear infinite; }
.ring-spin-rev { transform-origin: center; animation: spin 34s linear infinite reverse; opacity: 0.85; }
@keyframes spin { to { transform: rotate(360deg); } }

.avatar-photo {
  position: absolute; inset: 9%;
  border-radius: 50%; overflow: hidden;
  border: 1px solid rgba(242, 217, 154, 0.28);
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.55),
    0 0 0 10px rgba(202, 162, 90, 0.05),
    inset 0 0 40px rgba(0, 0, 0, 0.25);
}
.avatar-photo img { width: 100%; height: 100%; object-fit: cover; }

.hero-visual-caption { text-align: center; max-width: 40ch; }

/* ---------- Sections ---------- */
.section { padding: 40px 0; position: relative; }
.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-header { max-width: 720px; margin-bottom: 32px; }

.section-tag {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: 0.76rem;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--gold-300); margin-bottom: 12px;
}
.section-tag::before { content: ""; width: 34px; height: 1px; background: var(--gold-grad); }

.section-title {
  font-size: clamp(1.8rem, 3.4vw, 2.7rem);
  font-weight: 800; line-height: 1.2; letter-spacing: -0.015em;
}

.section-lede { margin-top: 12px; color: var(--text-dim); font-size: 1.03rem; max-width: 58ch; }

/* ---------- Glass card ---------- */
.glass-card {
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  position: relative;
}
.glass-card::before {
  /* hairline gold sheen on the top edge */
  content: ""; position: absolute; top: 0; left: 8%; right: 8%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(242, 217, 154, 0.4), transparent);
}

/* ---------- Ascent chart ---------- */
.ascent-chart {
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(10px, 3vw, 34px);
  overflow-x: auto;
}
.ascent-chart svg { width: 100%; min-width: 640px; height: auto; display: block; }

.ascent-path {
  stroke-dasharray: 1400; stroke-dashoffset: 1400;
}
.js .in-view .ascent-path { animation: draw-path 2.4s var(--ease-out) 0.2s forwards; }
.no-js .ascent-path, html.js .ascent-chart:not(.will-reveal) .ascent-path { stroke-dashoffset: 0; }
@keyframes draw-path { to { stroke-dashoffset: 0; } }

.ascent-area { opacity: 0; transition: opacity 1s ease 1.4s; }
.in-view .ascent-area { opacity: 1; }
.no-js .ascent-area { opacity: 1; }

.ascent-node circle {
  fill: var(--node-fill); stroke: var(--gold-500); stroke-width: 2;
}
.ascent-node-now circle:first-of-type { fill: var(--gold-500); }
.node-pulse {
  fill: none; stroke: var(--gold-300); stroke-width: 1; opacity: 0.5;
  animation: node-ring 2.4s ease-out infinite;
  transform-origin: 830px 84px;
}
@keyframes node-ring {
  0% { transform: scale(0.6); opacity: 0.7; }
  100% { transform: scale(1.5); opacity: 0; }
}

.ascent-node text { text-anchor: middle; font-family: var(--font-sans); }
.node-year { fill: var(--text-faint); font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.06em; }
.node-role { fill: var(--text); font-size: 16.5px; font-weight: 700; }
.node-org { fill: var(--gold-300); font-size: 12.5px; letter-spacing: 0.04em; }

.js .ascent-node { opacity: 0; transform: translateY(8px); transition: opacity 0.7s ease, transform 0.7s var(--ease-out); transition-delay: calc(0.55s + var(--i) * 0.35s); }
.js .in-view .ascent-node { opacity: 1; transform: none; }

/* hover tooltips on the milestones */
.ascent-node .node-hit { fill: transparent; stroke: none; cursor: pointer; }
.ascent-node:hover .node-role { fill: var(--gold-100); }

.node-tooltip {
  opacity: 0; pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
  /* delay-less: the reveal transition-delay on .ascent-node must not slow the tooltip */
  transition-delay: 0s;
}
.ascent-node:hover .node-tooltip { opacity: 1; transform: translateY(0); }

.node-tooltip rect {
  fill: var(--tip-bg-solid);
  stroke: rgba(202, 162, 90, 0.45); stroke-width: 1;
}
.node-tooltip .tip-caret {
  fill: var(--tip-bg-solid);
  stroke: rgba(202, 162, 90, 0.45); stroke-width: 1;
}
.node-tooltip .tip-duration {
  fill: var(--gold-300); font-family: var(--font-mono);
  font-size: 15px; font-weight: 600; letter-spacing: 0.02em;
}
.node-tooltip .tip-detail { fill: var(--text-dim); font-size: 13px; }

/* journey highlight cards */
.journey-highlights {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px; margin-top: 16px;
}
.highlight-card {
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 24px;
  transition: transform 0.3s var(--ease-out), border-color 0.3s;
}
.highlight-card:hover { transform: translateY(-4px); border-color: rgba(202, 162, 90, 0.4); }
.highlight-num {
  display: block; font-family: var(--font-mono); font-weight: 600; font-size: 1.6rem;
  background: var(--gold-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  margin-bottom: 10px;
}
.highlight-card p { color: var(--text-dim); font-size: 0.93rem; }

/* ---------- Experience ---------- */
.xp-layout { display: flex; flex-direction: column; gap: 40px; }

.company-meta {
  display: flex; align-items: center; gap: 20px; margin-bottom: 22px;
}
.company-logo {
  width: 58px; height: 58px; border-radius: 16px; flex: none;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 600; font-size: 0.95rem;
  color: var(--gold-100);
  background: linear-gradient(160deg, rgba(202, 162, 90, 0.16), rgba(202, 162, 90, 0.05));
  border: 1px solid rgba(202, 162, 90, 0.35);
}
/* Real brand logos sit on a white tile so their own colors read
   correctly on both the dark and light themes. */
.company-logo-img { background: #fff; padding: 8px; overflow: hidden; }
.company-logo-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.company-name { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.01em; }
.company-industry { color: var(--text-dim); font-size: 0.9rem; }
.company-period { font-family: var(--font-mono); font-size: 0.78rem; color: var(--gold-300); letter-spacing: 0.08em; margin-top: 3px; }

.timeline { display: flex; flex-direction: column; }

.timeline-item { display: grid; grid-template-columns: 30px 1fr; gap: 22px; }

.timeline-rail { position: relative; display: flex; justify-content: center; }
.timeline-rail::before {
  content: ""; position: absolute; top: 8px; bottom: -8px; width: 1px;
  background: linear-gradient(180deg, rgba(202, 162, 90, 0.55), var(--border) 70%);
}
.timeline-item:last-child .timeline-rail::before { bottom: auto; height: calc(100% - 8px); background: linear-gradient(180deg, rgba(202,162,90,.55), transparent); }

.timeline-dot {
  position: relative; z-index: 1; margin-top: 8px;
  width: 13px; height: 13px; border-radius: 50%; flex: none;
  background: var(--node-fill); border: 2px solid var(--gold-500);
}
.timeline-item.is-current .timeline-dot {
  background: var(--gold-500);
  box-shadow: 0 0 0 5px rgba(202, 162, 90, 0.15), 0 0 18px rgba(202, 162, 90, 0.5);
}

.timeline-card {
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 26px; margin-bottom: 16px;
  transition: transform 0.3s var(--ease-out), border-color 0.3s, box-shadow 0.3s;
}
.timeline-card:hover {
  transform: translateX(4px);
  border-color: rgba(202, 162, 90, 0.35);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
}

.timeline-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 8px 18px; margin-bottom: 14px;
}
.role-title { font-size: 1.18rem; font-weight: 700; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.role-period { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-faint); letter-spacing: 0.06em; }

.role-flag {
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 11px; border-radius: 999px;
  color: var(--on-gold); background: var(--gold-grad);
}
.role-flag.flag-promo {
  color: var(--gold-100); background: rgba(202, 162, 90, 0.14);
  border: 1px solid rgba(202, 162, 90, 0.4);
}

.role-summary { color: var(--text-dim); margin-bottom: 16px; }
.role-summary b { color: var(--gold-100); }

.role-points { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.role-points li {
  position: relative; padding-left: 24px;
  color: var(--text-dim); font-size: 0.95rem;
}
.role-points li::before {
  content: ""; position: absolute; left: 2px; top: 0.62em;
  width: 7px; height: 7px; border-radius: 2px;
  background: var(--gold-grad); transform: rotate(45deg);
}

.role-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.role-tags li {
  font-family: var(--font-mono); font-size: 0.73rem; letter-spacing: 0.03em;
  color: var(--gold-100);
  background: rgba(202, 162, 90, 0.09);
  border: 1px solid rgba(202, 162, 90, 0.25);
  padding: 6px 13px; border-radius: 999px;
}

/* ---------- ERP spotlight ---------- */
.erp-spotlight { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: stretch; }

.erp-main { padding: 30px 32px; }
.case-badge {
  display: inline-block;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--gold-100); background: rgba(202, 162, 90, 0.12);
  border: 1px solid rgba(202, 162, 90, 0.35);
  padding: 7px 15px; border-radius: 999px; margin-bottom: 20px;
}
.erp-head h3 { font-size: 1.6rem; font-weight: 800; margin-bottom: 14px; letter-spacing: -0.01em; }
.erp-head p { color: var(--text-dim); max-width: 62ch; margin-bottom: 22px; }

.erp-modules {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px;
}
.erp-modules li {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.9rem; font-weight: 500;
  transition: border-color 0.25s, background 0.25s, transform 0.25s var(--ease-out);
}
.erp-modules li:hover {
  border-color: rgba(202, 162, 90, 0.45);
  background: rgba(202, 162, 90, 0.07);
  transform: translateY(-2px);
}
.erp-modules svg {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: var(--gold-300); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}

.erp-side { display: flex; flex-direction: column; gap: 18px; }
.erp-fact {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  padding: 20px 26px; gap: 6px;
}
.fact-num {
  font-family: var(--font-mono); font-weight: 600; font-size: 2rem; line-height: 1;
  background: var(--gold-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.fact-label { color: var(--text-dim); font-size: 0.9rem; }

/* Demo access card */
.erp-demo { gap: 10px; }
.demo-title {
  display: flex; align-items: center; gap: 9px;
  color: var(--text-dim); font-size: 0.9rem;
}
.demo-title svg {
  width: 16px; height: 16px; flex: none;
  fill: none; stroke: var(--gold-300); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.demo-link {
  font-family: var(--font-mono); font-weight: 600; font-size: 1.35rem; line-height: 1.1;
  background: var(--gold-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  width: fit-content;
  border-bottom: 1px solid rgba(202, 162, 90, 0.35);
  transition: border-color 0.25s;
}
.demo-link:hover { border-bottom-color: rgba(202, 162, 90, 0.8); }
.demo-cred { display: flex; flex-direction: column; gap: 4px; margin: 2px 0 0; }
.demo-cred > div { display: flex; align-items: baseline; gap: 8px; }
.demo-cred dt {
  color: var(--text-dim); font-size: 0.78rem; letter-spacing: 0.02em;
  flex: none; min-width: 72px;
}
.demo-cred dd {
  margin: 0; font-family: var(--font-mono); font-size: 0.85rem;
  color: var(--text); overflow-wrap: anywhere;
}

/* ---------- Skills ---------- */
.skills-layout { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; }

.competency-group { padding: 28px 30px; }
.competency-title {
  display: flex; align-items: center; gap: 14px;
  font-size: 1.2rem; font-weight: 700; margin-bottom: 20px;
}
.competency-title.mt { margin-top: 26px; }
.competency-title svg {
  width: 22px; height: 22px; flex: none;
  fill: none; stroke: var(--gold-300); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.competency-desc { color: var(--text-dim); font-size: 0.94rem; margin: -6px 0 18px; }

.skill-bars { display: flex; flex-direction: column; gap: 16px; }
.skill-info {
  display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 9px;
  font-size: 0.94rem;
}
.skill-info b { font-family: var(--font-mono); font-size: 0.8rem; color: var(--gold-300); font-weight: 600; }

.skill-bar {
  height: 7px; border-radius: 99px;
  background: var(--bar-track);
  overflow: hidden;
}
.skill-bar span {
  display: block; height: 100%; width: var(--pct); border-radius: inherit;
  background: var(--gold-grad);
  position: relative;
}
.js .skill-bar span { width: 0; transition: width 1.3s var(--ease-out) 0.25s; }
.js .in-view .skill-bar span { width: var(--pct); }
.skill-bar span::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  animation: shimmer 2.6s ease-in-out infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  55%, 100% { transform: translateX(100%); }
}

.tech-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.tech-grid li {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 0.8rem;
  padding: 9px 16px; border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--border);
  color: var(--text-dim);
  transition: color 0.25s, border-color 0.25s, background 0.25s, transform 0.25s var(--ease-out);
}
.tech-grid li:hover {
  color: var(--gold-100); border-color: rgba(202, 162, 90, 0.45);
  background: rgba(202, 162, 90, 0.07); transform: translateY(-2px);
}
.tech-grid li svg { width: 17px; height: 17px; flex: none; }
.tech-grid li svg.generic {
  fill: none; stroke: var(--gold-300); stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}

/* philosophy */
.philosophy {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  margin-top: 18px;
}
.philosophy-item {
  padding: 24px 24px 22px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  transition: transform 0.3s var(--ease-out), border-color 0.3s;
}
.philosophy-item:hover { transform: translateY(-4px); border-color: rgba(202, 162, 90, 0.4); }
.philosophy-index {
  display: inline-grid; place-items: center;
  min-width: 40px; height: 40px; padding: 0 10px; border-radius: 12px;
  font-family: var(--font-mono); font-weight: 600; color: var(--gold-300);
  background: rgba(202, 162, 90, 0.1); border: 1px solid rgba(202, 162, 90, 0.3);
  margin-bottom: 18px;
}
.philosophy-item h4 { font-size: 1.05rem; font-weight: 700; margin-bottom: 10px; }
.philosophy-item p { color: var(--text-dim); font-size: 0.92rem; }

/* ---------- Contact ---------- */
.contact-panel {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
  padding: clamp(30px, 4vw, 48px);
}
.contact-intro p { color: var(--text-dim); margin-top: 18px; max-width: 44ch; }

.contact-list { display: flex; flex-direction: column; gap: 22px; }
.contact-list li { display: flex; align-items: center; gap: 18px; }
.contact-ico {
  width: 50px; height: 50px; border-radius: 14px; flex: none;
  display: grid; place-items: center;
  background: rgba(202, 162, 90, 0.1);
  border: 1px solid rgba(202, 162, 90, 0.3);
}
.contact-ico svg {
  width: 21px; height: 21px;
  fill: none; stroke: var(--gold-300); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.contact-label {
  display: block; font-family: var(--font-mono); font-size: 0.7rem;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-faint);
  margin-bottom: 3px;
}
.contact-list a, .contact-list div > span:not(.contact-label) { font-weight: 600; font-size: 1.02rem; }
.contact-list a:hover { color: var(--gold-300); }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--border); padding: 30px 0; }
.footer-content { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.copyright { color: var(--text-faint); font-size: 0.88rem; }

.social-links { display: flex; gap: 12px; }
.social-links a {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  transition: border-color 0.25s, background 0.25s, transform 0.25s var(--ease-out);
}
.social-links a:hover { border-color: rgba(202, 162, 90, 0.5); background: rgba(202, 162, 90, 0.08); transform: translateY(-3px); }
.social-links svg { width: 18px; height: 18px; fill: var(--text-dim); stroke: none; }
.social-links a:hover svg { fill: var(--gold-300); }
.social-links a[aria-label="Email"] svg,
.social-links a[aria-label="LinkedIn"] svg { fill: none; stroke: var(--text-dim); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.social-links a[aria-label="Email"]:hover svg,
.social-links a[aria-label="LinkedIn"]:hover svg { stroke: var(--gold-300); }

/* ---------- Reveal animations (JS-gated) ---------- */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.8s ease, transform 0.8s var(--ease-out); }
.js .reveal.in-view { opacity: 1; transform: none; }
.js .reveal.delay-1 { transition-delay: 0.12s; }
.js .reveal.delay-2 { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .js .ascent-path { stroke-dashoffset: 0; }
  .js .ascent-node { opacity: 1; transform: none; }
  .js .skill-bar span { width: var(--pct); }
}

/* ---------- Light-theme fine-tuning ---------- */
/* darker shadows and pale-gold details need adjusting on ivory */
html[data-theme="light"] .avatar-photo {
  border-color: rgba(138, 100, 38, 0.35);
  box-shadow:
    0 30px 70px rgba(63, 50, 24, 0.22),
    0 0 0 10px rgba(168, 126, 53, 0.06),
    inset 0 0 40px rgba(63, 50, 24, 0.08);
}
html[data-theme="light"] .logo-photo { border-color: rgba(138, 100, 38, 0.45); }
html[data-theme="light"] .side-tip { box-shadow: 0 12px 28px rgba(63, 50, 24, 0.18); }
html[data-theme="light"] .timeline-card:hover { box-shadow: 0 18px 44px rgba(63, 50, 24, 0.14); }
html[data-theme="light"] .theme-toggle:hover,
html[data-theme="light"] .theme-toggle:focus-visible { box-shadow: 0 8px 20px rgba(63, 50, 24, 0.18); }

/* re-tint the inline SVG gradients (career chart + avatar ring):
   their pale-gold stops would wash out on the light background */
html[data-theme="light"] #ascent-line stop:nth-of-type(3) { stop-color: #8a6426; }
html[data-theme="light"] #ascent-line stop:nth-of-type(2) { stop-color: #a87e35; }
html[data-theme="light"] #ring-gold stop:nth-of-type(1) { stop-color: #c9a254; }
html[data-theme="light"] #ring-gold stop:nth-of-type(3) { stop-color: #8a6426; }

/* ---------- Utility ---------- */
.print-only { display: none; }
.sm-only { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .hero-title br { display: none; }
  .hero-grid { grid-template-columns: 1fr; gap: 52px; }
  .hero-visual { order: -1; }
  .hero { padding-top: calc(var(--header-h) + 40px); }
  .avatar-frame { width: min(280px, 70vw); }
  .skills-layout, .erp-spotlight { grid-template-columns: 1fr; }
  .erp-side { flex-direction: row; }
  .erp-fact { padding: 22px; }
  .journey-highlights, .philosophy { grid-template-columns: 1fr; }
  .contact-panel { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 900px) {
  .side-nav { display: none; }
  /* keep only the theme toggle, docked to the bottom-right corner */
  .side-rail { top: auto; bottom: 22px; transform: none; }
  /* tablet down: keep the brand (logo + name) and the CV button always
     visible; the contact list is the first thing to give up its room */
  .header-contact { display: none; }
}

@media (max-width: 760px) {
  .sm-only { display: inline; }
  .section { padding: 32px 0; }

  .container.nav-container { padding-left: 18px; padding-right: 18px; }
  .nav-container { gap: 14px; }

  .erp-side { flex-direction: column; }
  .timeline-item { grid-template-columns: 20px 1fr; gap: 14px; }
  .timeline-card { padding: 24px 22px; }
  .erp-main { padding: 28px 24px; }
  .competency-group { padding: 28px 24px; }
  .company-meta { align-items: flex-start; }
}

/* narrow phones: collapse the CV button down to just its icon so the
   logo photo + name never lose their space */
@media (max-width: 420px) {
  .nav-cta { padding: 10px; gap: 0; }
  .nav-cta-label { display: none; }
}

