:root {
  --bg: #05070f;
  --bg-soft: #0a0f1d;
  --bg-elev: #0e1424;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-hover: rgba(255, 255, 255, 0.075);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.17);
  --text: #e9eefb;
  --text-muted: #94a1bd;
  --text-dim: #6b7893;

  --brand: #6366f1;
  --brand-2: #22d3ee;
  --ok: #34d399;

  --brand-soft: rgba(99, 102, 241, 0.16);
  --brand-line: rgba(99, 102, 241, 0.42);

  --gradient-brand: linear-gradient(135deg, #6366f1 0%, #8b5cf6 45%, #22d3ee 100%);
  --gradient-text: linear-gradient(120deg, #a5b4fc 0%, #22d3ee 45%, #f472b6 100%);

  --shadow-md: 0 18px 40px -22px rgba(0, 0, 0, 0.85);
  --shadow-lg: 0 34px 80px -34px rgba(0, 0, 0, 0.9);
  --glow: 0 0 0 1px rgba(99, 102, 241, 0.35), 0 18px 50px -18px rgba(99, 102, 241, 0.55);

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --pill: 999px;

  --container: 1140px;
  --header-h: 68px;

  --font-sans: "Inter", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.32s;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-soft: #ffffff;
  --bg-elev: #ffffff;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-hover: #ffffff;
  --border: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(15, 23, 42, 0.18);
  --text: #0f172a;
  --text-muted: #55617a;
  --text-dim: #7c8798;

  --brand-soft: rgba(99, 102, 241, 0.12);
  --brand-line: rgba(99, 102, 241, 0.3);

  --gradient-text: linear-gradient(120deg, #4f46e5 0%, #0891b2 50%, #db2777 100%);

  --shadow-md: 0 18px 40px -26px rgba(15, 23, 42, 0.28);
  --shadow-lg: 0 34px 80px -40px rgba(15, 23, 42, 0.35);
  --glow: 0 0 0 1px rgba(99, 102, 241, 0.22), 0 18px 44px -22px rgba(79, 70, 229, 0.38);
  color-scheme: light;
}

/* ================= base ================= */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60rem 40rem at 12% -10%, rgba(99, 102, 241, 0.16), transparent 60%),
    radial-gradient(48rem 34rem at 92% 6%, rgba(34, 211, 238, 0.12), transparent 62%),
    radial-gradient(50rem 40rem at 50% 108%, rgba(244, 114, 182, 0.09), transparent 60%);
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }
strong { color: var(--text); font-weight: 700; }

h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; letter-spacing: -0.015em; }

::selection { background: rgba(99, 102, 241, 0.35); color: #fff; }

:focus-visible{ outline: 2px solid var(--brand-2); outline-offset: 3px; border-radius: 6px; }

/* ================= layout helpers ================= */
.container{ width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 24px; }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.mono-tag, .typed { font-family: var(--font-mono); }
.icon {
  width: 1em;
  height: 1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 50%;
  z-index: 200;
  transform: translate(-50%, -200%);
  padding: 10px 18px;
  border-radius: var(--pill);
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  transition: transform var(--dur) var(--ease);
}
.skip-link:focus { transform: translate(-50%, 0); }

.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 120;
  height: 3px;
  background: transparent;
}
.scroll-progress > span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--gradient-brand);
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.7);
  transition: width 0.08s linear;
}

.btn {
  --btn-bg: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 22px;
  border: 1px solid var(--border);
  border-radius: var(--pill);
  background: var(--btn-bg);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn .icon { font-size: 1.05em; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  border-color: transparent;
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: var(--glow);
}
.btn-primary:hover { box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.5), 0 22px 55px -18px rgba(99, 102, 241, 0.8); }

.btn-ghost { background: var(--surface); backdrop-filter: blur(10px); }
.btn-ghost:hover { border-color: var(--border-strong); background: var(--surface-hover); }

.btn-sm { padding: 10px 16px; font-size: 14px; }

.panel {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-md);
}
.panel-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}
.panel-title .icon { font-size: 1.15em; color: var(--brand-2); }

.tag,
.chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--pill);
  background: var(--brand-soft);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.5;
  transition: all var(--dur) var(--ease);
}
.tag:hover,
.chip:hover{ border-color: var(--brand-line); color: var(--text); transform: translateY(-2px); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.pulse-dot {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
}
.pulse-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--ok);
  animation: pulse 2s var(--ease) infinite;
}
@keyframes pulse {
  0% { transform: scale(0.7); opacity: 0.9; }
  70% { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(1.6); opacity: 0; }
}

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ================= sections ================= */
.section { padding: 96px 0; }
.section-alt { background: linear-gradient(180deg, var(--bg-soft), transparent 55%); }

.section-head { max-width: 720px; margin-bottom: 46px; }
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 6px 14px;
  border: 1px solid var(--brand-line);
  border-radius: var(--pill);
  background: var(--brand-soft);
  color: var(--brand-2);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.section-kicker .icon { font-size: 1em; }
.section-title {
  font-size: clamp(28px, 4.4vw, 40px);
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.section-sub { margin-top: 14px; color: var(--text-muted); font-size: 16px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  z-index: 150;
  padding: 12px 22px;
  border: 1px solid var(--border-strong);
  border-radius: var(--pill);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translate(-50%, 24px);
  pointer-events: none;
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
/* ================= header + navigation ================= */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}
.site-header.is-scrolled {
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom-color: var(--border);
  box-shadow: 0 10px 34px -24px rgba(0, 0, 0, 0.9);
}

.header-inner{ display: flex; align-items: center; justify-content: space-between; gap: 20px; }

.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 800; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--gradient-brand);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: var(--glow);
}
.brand-text { font-size: 17px; letter-spacing: -0.01em; }
.brand-dot { color: var(--brand-2); }

.nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  position: relative;
  padding: 9px 14px;
  border-radius: var(--pill);
  color: var(--text-muted);
  font-size: 14.5px;
  font-weight: 500;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.nav-link:hover,
.nav-link.is-active { color: var(--text); background: var(--surface); }
.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--gradient-brand);
  transform: translateX(-50%);
}

.header-actions { display: flex; align-items: center; gap: 10px; }

/* header buttons: the square icon button and the language switch share one skin */
.icon-btn,
.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-muted);
  transition: all var(--dur) var(--ease);
}
.icon-btn { width: 40px; font-size: 18px; }
.lang-btn { padding: 0 13px; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; }
.lang-btn .icon { font-size: 15px; }
.icon-btn:hover,
.lang-btn:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-2px); }

#themeToggle .icon-sun { display: none; }
[data-theme="light"] #themeToggle .icon-sun { display: block; }
[data-theme="light"] #themeToggle .icon-moon { display: none; }

.nav-toggle { display: none; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-menu { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }
/* ================= hero ================= */
.hero {
  position: relative;
  padding: calc(var(--header-h) + 76px) 0 60px;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  animation: float 18s var(--ease) infinite alternate;
}
.aurora-1 { width: 44vw; height: 44vw; top: -12vw; left: -8vw; background: #4f46e5; }
.aurora-2 { width: 34vw; height: 34vw; top: 8vw; right: -6vw; background: #0891b2; animation-delay: -6s; }
.aurora-3 { width: 30vw; height: 30vw; bottom: -8vw; left: 28vw; background: #db2777; opacity: 0.35; animation-delay: -12s; }
[data-theme="light"] .aurora { opacity: 0.22; }
[data-theme="light"] .aurora-3 { opacity: 0.16; }

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.14) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.14) 1px, transparent 1px);
  background-size: 62px 62px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 34%, #000 0%, transparent 78%);
  mask-image: radial-gradient(70% 60% at 50% 34%, #000 0%, transparent 78%);
}

@keyframes float {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(4vw, 4vw, 0) scale(1.16); }
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.75fr);
  align-items: center;
  gap: 56px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: var(--pill);
  background: var(--surface);
  backdrop-filter: blur(10px);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
}

.hero-title{ font-size: clamp(34px, 5.6vw, 60px); font-weight: 800; letter-spacing: -0.03em; }
.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% 100%;
  animation: shine 8s linear infinite;
}
@keyframes shine { to { background-position: 200% 50%; } }

.hero-role {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  margin-top: 16px;
  color: var(--text);
  font-size: clamp(17px, 2.3vw, 24px);
  font-weight: 600;
}
.mono-tag { color: var(--brand-2); font-weight: 600; }
.typed { color: var(--text); }
.caret {
  display: inline-block;
  width: 2px;
  height: 1.15em;
  background: var(--brand-2);
  animation: blink 1.05s steps(2, start) infinite;
  vertical-align: -0.15em;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-desc{ max-width: 62ch; margin-top: 20px; color: var(--text-muted); font-size: 16.5px; }

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

.hero-socials { display: flex; gap: 12px; margin-top: 30px; }
.social-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 18px;
  transition: all var(--dur) var(--ease);
}
.social-btn:hover {
  color: #fff;
  border-color: transparent;
  background: var(--gradient-brand);
  transform: translateY(-3px);
  box-shadow: var(--glow);
}
.hero-card {
  position: relative;
  padding: 30px 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: cardIn 0.9s var(--ease) both 0.15s;
}
.hero-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, rgba(99, 102, 241, 0.6), transparent 42%, rgba(34, 211, 238, 0.45));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.avatar-ring {
  position: relative;
  width: 132px;
  height: 132px;
  margin: 0 auto 18px;
  border-radius: 50%;
  padding: 4px;
  background: var(--gradient-brand);
  box-shadow: 0 18px 44px -20px rgba(99, 102, 241, 0.85);
}
.avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-elev);
}
.avatar-status {
  position: absolute;
  right: 6px;
  bottom: 10px;
  width: 18px;
  height: 18px;
  border: 3px solid var(--bg);
  border-radius: 50%;
  background: var(--ok);
}

.card-name { font-size: 22px; }
.card-role {
  margin-top: 4px;
  color: var(--brand-2);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
}

.card-facts {
  display: grid;
  gap: 10px;
  margin: 22px 0;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.card-facts li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 14px;
}
.card-facts .icon { color: var(--brand-2); font-size: 1.05em; }

.card-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 64px;
  padding: 24px 8px;
  border-top: 1px solid var(--border);
}
.stat { text-align: center; }
.stat-num {
  display: block;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-family: var(--font-mono);
  font-size: clamp(24px, 3.4vw, 34px);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.stat-label { display: block; margin-top: 4px; color: var(--text-dim); font-size: 13px; }

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  transition: color var(--dur) var(--ease);
}
.scroll-hint:hover { color: var(--text); }
.scroll-hint .icon { font-size: 1.1em; animation: bob 1.8s var(--ease) infinite; }
@keyframes bob {
  0%, 100% { transform: translateY(-2px); }
  50% { transform: translateY(3px); }
}
/* ================= about ================= */
.about-grid{ display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.85fr); gap: 34px; }
.about-text p { color: var(--text-muted); font-size: 16.5px; }
.about-text p + p { margin-top: 16px; }

.about-points { display: grid; gap: 12px; margin-top: 24px; }
.about-points li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 15px;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.about-points li:hover { transform: translateX(5px); border-left-color: var(--brand-2); }
.about-points .icon { margin-top: 5px; color: var(--ok); font-size: 1.05em; }

.about-side { display: grid; gap: 22px; align-content: start; }

.value-grid{ display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-top: 46px; }
.value-card {
  position: relative;
  padding: 26px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(12px);
  overflow: hidden;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}
.value-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--gradient-brand);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.value-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}
.value-card:hover::before { opacity: 1; }
.value-card h3 { margin-bottom: 8px; font-size: 17px; }
.value-card p { color: var(--text-muted); font-size: 14.5px; }
.value-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  color: var(--brand-2);
  font-size: 21px;
}

/* ================= skills ================= */
.skills-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 26px;
  align-items: start;
}
.skills-right { display: grid; gap: 22px; }

.bars { display: grid; gap: 20px; }
.bar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 9px;
  color: var(--text);
  font-size: 14.5px;
  font-weight: 500;
}
.bar-pct{ color: var(--brand-2); font-family: var(--font-mono); font-size: 13px; font-weight: 600; }
.bar-track {
  position: relative;
  height: 8px;
  border-radius: var(--pill);
  background: color-mix(in srgb, var(--text-dim) 18%, transparent);
  overflow: hidden;
}
.bar-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--gradient-brand);
  box-shadow: 0 0 16px -2px rgba(99, 102, 241, 0.85);
  transition: width 1.25s var(--ease);
}
.bar-item.is-filled .bar-fill { width: var(--fill, 0%); }
/* ================= experience ================= */
.timeline { position: relative; display: grid; gap: 26px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 16px;
  bottom: 16px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2) 55%, transparent);
  opacity: 0.55;
}

.tl-item{ position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 20px; }
.tl-marker { display: flex; justify-content: center; padding-top: 28px; }
.tl-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 3px solid var(--brand);
  background: var(--bg);
  box-shadow: 0 0 0 5px var(--brand-soft);
  transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.tl-item:hover .tl-dot { border-color: var(--brand-2); box-shadow: 0 0 0 7px var(--brand-soft); }

.tl-body { padding: 24px 26px; transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease); }
.tl-body:hover { border-color: var(--border-strong); transform: translateX(4px); }

.tl-note {
  margin-bottom: 16px;
  padding: 11px 15px;
  border-left: 2px solid var(--brand-line);
  border-radius: 0 12px 12px 0;
  background: var(--brand-soft);
  color: var(--text-muted);
  font-size: 13.5px;
}

.tl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.tl-role { font-size: 19px; }
.tl-company { margin-top: 5px; color: var(--text-muted); font-size: 14.5px; }
.tl-period {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border: 1px solid var(--border);
  border-radius: var(--pill);
  background: var(--brand-soft);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12.5px;
  white-space: nowrap;
}
.tl-period .icon { font-size: 1em; }

.tl-list { display: grid; gap: 10px; }
.tl-list li{ position: relative; padding-left: 20px; color: var(--text-muted); font-size: 15px; }
.tl-list li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-2);
  opacity: 0.85;
}
.tl-tags{ margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--border); }

/* ================= projects ================= */
.project-grid { display: grid; gap: 22px; }

.project-card {
  position: relative;
  display: flex;
  flex-direction: row;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}
.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%),
    rgba(99, 102, 241, 0.16), transparent 46%);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
  pointer-events: none;
}
.project-card:hover {
  transform: translateY(-8px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}
.project-card:hover::before { opacity: 1; }

.project-thumb {
  position: relative;
  display: grid;
  place-items: center;
  width: 190px;
  flex: none;
  align-self: stretch;
  color: #fff;
  overflow: hidden;
}
.project-thumb .icon {
  position: relative;
  z-index: 2;
  font-size: 40px;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.35));
  transition: transform var(--dur) var(--ease);
}
.project-card:hover .project-thumb .icon { transform: scale(1.12) rotate(-4deg); }
.project-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.25) 1px, transparent 1px);
  background-size: 13px 13px;
  opacity: 0.45;
}
.thumb-1 { background: linear-gradient(135deg, #6366f1, #22d3ee); }
.thumb-2 { background: linear-gradient(135deg, #0ea5e9, #8b5cf6); }

.project-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  padding: 4px 12px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: var(--pill);
  background: rgba(2, 6, 23, 0.34);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.project-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 15px;
  padding: 24px 26px;
}
.project-title { font-size: 18px; }
.project-desc { color: var(--text-muted); font-size: 14.5px; }

.more-line { margin-top: 42px; text-align: center; }

/* ================= contact ================= */
.contact-grid{ display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.contact-card {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  text-align: left;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}
.contact-card:hover {
  transform: translateY(-5px);
  border-color: var(--brand-line);
  box-shadow: var(--shadow-lg);
}
.contact-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: none;
  border: 1px solid var(--brand-line);
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand-2);
  font-size: 21px;
}
.contact-text { display: grid; gap: 3px; flex: 1; min-width: 0; }
.contact-label { color: var(--text-dim); font-size: 12.5px; }
.contact-value { font-size: 15px; overflow-wrap: anywhere; }
.contact-action { display: grid; place-items: center; flex: none; color: var(--text-dim); font-size: 17px; }
.contact-card .icon-copied { display: none; }
.contact-card.is-copied .icon-copy { display: none; }
.contact-card.is-copied .icon-copied { display: block; color: var(--ok); }

/* ================= footer ================= */
.site-footer {
  margin-top: 40px;
  padding: 40px 0 30px;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, transparent, var(--bg-soft));
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-name { font-size: 15px; font-weight: 700; }
.footer-note { color: var(--text-dim); font-size: 12.5px; }
.footer-socials { display: flex; gap: 10px; }
.footer-socials .social-btn { width: 38px; height: 38px; border-radius: 11px; font-size: 16px; }
.footer-copy {
  width: 100%;
  padding-top: 20px;
  border-top: 1px dashed var(--border);
  color: var(--text-dim);
  font-size: 12.5px;
  text-align: center;
}

.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 110;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--bg-elev);
  color: var(--text);
  font-size: 18px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(18px) scale(0.9);
  pointer-events: none;
  transition: all var(--dur) var(--ease);
}
.to-top.is-show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover {
  border-color: transparent;
  background: var(--gradient-brand);
  color: #fff;
  transform: translateY(-3px);
}
/* ================= responsive ================= */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; gap: 44px; }
  .hero-card { max-width: 420px; margin-inline: auto; }
  .hero { min-height: auto; padding-bottom: 90px; }
  .about-grid,
  .skills-grid { grid-template-columns: 1fr; }
  .value-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .nav-toggle { display: grid; }
  .header-cta { display: none; }
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 16px 24px 26px;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    max-height: calc(100svh - var(--header-h));
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-14px);
    transition: opacity 0.28s var(--ease), transform 0.28s var(--ease), visibility 0.28s;
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav-link { padding: 13px 16px; border-radius: 12px; font-size: 16px; }
  .nav-link.is-active { box-shadow: inset 3px 0 0 var(--brand); }
  .nav-link.is-active::after { display: none; }

  .section { padding: 74px 0; }
  .timeline::before { left: 8px; }
  .tl-item { grid-template-columns: 18px minmax(0, 1fr); gap: 14px; }
  .tl-body { padding: 20px 20px; }
  .tl-body:hover { transform: none; }

  .project-card { flex-direction: column; }
  .project-thumb { width: auto; height: 108px; }
}

@media (max-width: 640px) {
  html { font-size: 15.5px; }
  .container { padding-inline: 18px; }
  .section { padding: 62px 0; }
  .section-head { margin-bottom: 34px; }
  .panel { padding: 20px; }

  .hero { padding-top: calc(var(--header-h) + 48px); padding-bottom: 70px; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; margin-top: 44px; }
  .hero-actions .btn { width: 100%; }
  .value-grid { grid-template-columns: 1fr; }
  .scroll-hint { display: none; }

  .tl-head { flex-direction: column; }
  .tl-period { align-self: flex-start; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .to-top { right: 16px; bottom: 16px; }
  .toast { left: 16px; right: 16px; transform: translateY(24px); }
  .toast.is-show { transform: none; }
}

@media (max-width: 480px) {
  .lang-btn { padding: 0 10px; font-size: 12px; }
  .lang-btn .icon { display: none; }
}

@media (max-width: 420px) {
  .hero-card { padding: 24px 18px; }
  .avatar-ring { width: 108px; height: 108px; }
}

@media (max-width: 380px) {
  .brand-text { display: none; }
}

/* ================= fallbacks ================= */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .panel,
  .hero-card,
  .value-card,
  .project-card,
  .contact-card { background: var(--bg-elev); }
}

/* ================= motion preferences ================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
  .bar-item .bar-fill { width: var(--fill, 0%) !important; }
}
